jacobkrantz/VLN-CE

ValueError: Type mismatch (<class 'habitat.config.default.Config'> vs. <class 'yacs.config.CfgNode'>) with values (DATASET:

W-xf opened this issue · 5 comments

W-xf commented

hello,I'm running python run.py --exp-config vlnce_ baselines/config/ nonlearning.yaml --The following error occurred during run type Eval:

ValueError: Type mismatch (<class 'habitat.config.default.Config'> vs. <class 'yacs.config.CfgNode'>) with values (DATASET:

I don't understand why the report is wrong. I look forward to your reply.

Hello,
I was unable to reproduce this error. Can you post more details about the error / steps to reproduce? Also, which version of Habitat-API and yacs are you running?

W-xf commented

Thank you very much for your reply.
The specific versions are as follows:
habitat-sim 0.1.5
habitat 0.1.5
yacs 0.1.7

The installation steps of habitat SIM 0.1.5 are as follows:
https://github.com/facebookresearch/habitat-sim
Install step 1 - step 3 python setup.py Install -- headless.

The habitat API installation steps are as follows https://github.com/facebookresearch/habitat-api To install.

Run Python after installation run.py --exp-config vlnce_ baselines/config/ nonlearning.yaml --run type train, an error is reported as follows:

  1. Error: spl measure requires distance_to_goal
    My correction: in vlnce_ task.yaml. Add the setting DISTANCE_TO_GOAL
  2. Add the setting DISTANCE_TO_GOAL. AssertionError: SPL measure requirements be listed after success in tje measures list in the config
    My correction: in vlnce_ task.yaml.
    Measures: [
    SUCCESS,
    SPL,
    ...] SUCCESS comes before SPL.

Run Python run.py --exp-config vlnce_ baselines/config/ nonlearning.yaml --run-type train. Succeeded. Generate train.log and data / checkpoints, data / tensorboard_ dirs, data/trajectories_ Dir three folders and their contents.

  1. Run python run.py --exp-config vlnce_ baselines/config/ nonlearning.yaml --run-type eval. And I want to generate a video of the navigation trajectory,
    So the return here is blocked
    if run_ type == "eval" and config.EVAL.EVAL_ NONLEARNING:
    evaluate_ agent(config)
    #return
    Let the program enter
    elif run_ type == "eval":
    trainer.eval ()
    After that, an error is reported: type mismatch (< class' habitat.config.default .Config'> vs. <class ' yacs.config.CfgNode '>) with values (DATASET:

The above is my operation of all steps. I appreciate it very much that you've spared your time to read. I looking forward to your reply.

Thanks for adding details! This repo was setup to run with Habitat v0.1.4. We just upgraded to use v0.1.5 [this commit: 00cae26]. The config type mismatch likely comes from importing Config from yacs instead of Habitat, which we fixed here in the same commit. Let me know if this solves your issue.

W-xf commented

Thank you very much for your kind attention personal response. These solved my issue.

After running:

  1. Program error: draw_collision has no definition.(habitat_extensions/utils.py)
    My modification method:
    from habitat.utils.visualizations import maps**,utils**
    On line 46: egocentric_view = **utils.**draw_collision(egocentric_view)

  2. Run
    TypeError: generate_video() got an unexpected keyword argument 'metric_name'
    My modification method:
    generate_video(
    video_option=config.VIDEO_OPTION,
    video_dir=config.VIDEO_DIR,
    images=rgb_frames[i],
    episode_id=current_episodes[i].episode_id,
    checkpoint_idx=checkpoint_index,
    metric_name="SPL",
    metric_value=round(
    stats_episodes[current_episodes[i].episode_id]["spl"], 6
    ),

    tb_writer=writer,
    )
    metric_name and metric_value changed to
    metrics={'SPL':round(
    stats_episodes[current_episodes[i].episode_id]["spl"], 6
    )},

  3. Run, set to:
    _C.EVAL_CKPT_PATH_DIR = "data/checkpoints"
    _C.VIDEO_OPTION = ["tensorboard"]

The program appears:
episodes evaluted: 10
episode distance_to_goal: 5.901008
episode success: 0.100000
episode spl: 0.064951
episode ndtw: 0.516084
episode path_length: 9.245487
episode oracle_success: 0.200000
episode steps_taken:239.300000

After that, the program will fall into an endless loop.
File "/home/habitat/habitat_baselines/common/base_trainer.py", line 103, in eval
time.sleep(2) # sleep for 2 secs before polling again

  1. Run, set to:
    _C.EVAL_CKPT_PATH_DIR = "data/checkpoints/ckpt.39.pth"
    _C.VIDEO_OPTION = ["tensorboard"]

episodes evaluted: 10
episode distance_to_goal: 5.901008
episode success: 0.100000
episode spl: 0.064951
episode ndtw: 0.516084
episode path_length: 9.245487
episode oracle_success: 0.200000
episode steps_taken:239.300000

It can end directly.

  1. Run, set to:
    _C.EVAL_CKPT_PATH_DIR = "data/checkpoints/ckpt.39.pth"
    _C.VIDEO_OPTION = ["disk"]

The following warning will appear:
a. IMAGEIO FFMPEG_WRITER WARNING: input image is not divisible by macro_block_size=16, resizing from (1073, 256) to (1088, 256) to ensure video compatibility with most codecs and players. To prevent resizing, make your input image divisible by the macro_block_size or set the macro_block_size to 1 (risking incompatibility).
b. [swscaler @ 0x63e6200] Warning: data is not aligned! This can lead to a speed loss

These are the problems that occurred after the modification. Thank you very much for taking the time to read. I look forward to your reply.

163af64 addresses concerns 1 and 2. The rest is expected behavior.