facebookresearch / synsin

View synthesis for the public.
http://www.robots.ox.ac.uk/~ow/synsin.html
Other
659 stars 93 forks source link

Evaluatiuon Exception error: Your results will NOT be comparable with results in the paper or online. #4

Closed phongnhhn92 closed 4 years ago

phongnhhn92 commented 4 years ago

Hi, I have been trying to replicate your result on the MP3D dataset and I receive this error :

/home/phong/anaconda3/envs/pytorch/bin/python /home/phong/data/Work/Paper3/Code/synsin/evaluation/eval.py --result_folder ../eval_mp3d/ --old_model ../modelcheckpoints/mp3d/synsin.pth --batch_size 8 --num_workers 0 --images_before_reset 200 --dataset mp3d
STARTING MAIN METHOD...
Model is:  ../modelcheckpoints/mp3d/synsin.pth
Loading dataset mp3d ...
Loading model %s ... 
RESNET encoder
RESNET decoder
['1.0_l1', '10.0_content']
<zip object at 0x7f353981a488>
Loaded models...
Restarting image_generator.... with seed 0 in train mode? True
gpu_id 0
data/scene_episodes/mp3d_test
One ep per scene
2020-04-06 10:08:19,606 initializing sim Sim-v0
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0406 10:08:19.607789 19727 Simulator.cpp:62] Loading navmesh from /media/phong/Data2TB/dataset/Matterport/Habitat/v1/tasks/mp3d_habitat/mp3d/oLBMNvg9in8/oLBMNvg9in8.navmesh
I0406 10:08:19.608074 19727 Simulator.cpp:64] Loaded.
I0406 10:08:19.608234 19727 SceneGraph.h:92] Created DrawableGroup: 
Renderer: GeForce RTX 2080 Ti/PCIe/SSE2 by NVIDIA Corporation
OpenGL version: 4.6.0 NVIDIA 435.21
Using optional features:
    GL_ARB_ES2_compatibility
    GL_ARB_direct_state_access
    GL_ARB_get_texture_sub_image
    GL_ARB_invalidate_subdata
    GL_ARB_multi_bind
    GL_ARB_robustness
    GL_ARB_separate_shader_objects
    GL_ARB_texture_filter_anisotropic
    GL_ARB_texture_storage
    GL_ARB_texture_storage_multisample
    GL_ARB_vertex_array_object
    GL_KHR_debug
Using driver workarounds:
    no-layout-qualifiers-on-old-glsl
    nv-zero-context-profile-mask
    nv-implementation-color-read-format-dsa-broken
    nv-cubemap-inconsistent-compressed-image-size
    nv-cubemap-broken-full-compressed-image-query
    nv-compressed-block-size-in-bits
I0406 10:08:19.680424 19727 ResourceManager.cpp:1119] Importing Basis files as BC7
I0406 10:08:23.214200 19727 Simulator.cpp:130] Loading house from /media/phong/Data2TB/dataset/Matterport/Habitat/v1/tasks/mp3d_habitat/mp3d/oLBMNvg9in8/oLBMNvg9in8.house
I0406 10:08:23.214274 19727 Simulator.cpp:136] Loading semantic mesh /media/phong/Data2TB/dataset/Matterport/Habitat/v1/tasks/mp3d_habitat/mp3d/oLBMNvg9in8/oLBMNvg9in8_semantic.ply
I0406 10:08:23.214280 19727 SceneGraph.h:92] Created DrawableGroup: 
I0406 10:08:31.861382 19727 Simulator.cpp:149] Loaded.
I0406 10:08:31.953205 19727 simulator.py:143] Loaded navmesh /media/phong/Data2TB/dataset/Matterport/Habitat/v1/tasks/mp3d_habitat/mp3d/oLBMNvg9in8/oLBMNvg9in8.navmesh
2020-04-06 10:08:31,955 Initializing task Nav-v0
I0406 10:08:32.014276 19727 Simulator.cpp:36] Deconstructing Simulator
I0406 10:08:32.014317 19727 SemanticScene.h:40] Deconstructing SemanticScene
I0406 10:08:32.017783 19727 SceneManager.h:24] Deconstructing SceneManager
I0406 10:08:32.017791 19727 SceneGraph.h:25] Deconstructing SceneGraph
I0406 10:08:32.017853 19727 RenderTarget.h:51] Deconstructing RenderTarget
I0406 10:08:32.018307 19727 Sensor.h:80] Deconstructing Sensor
I0406 10:08:32.018316 19727 RenderTarget.h:51] Deconstructing RenderTarget
I0406 10:08:32.018569 19727 Sensor.h:80] Deconstructing Sensor
I0406 10:08:32.018579 19727 SceneGraph.h:25] Deconstructing SceneGraph
I0406 10:08:32.027341 19727 Renderer.cpp:33] Deconstructing Renderer
I0406 10:08:32.027349 19727 WindowlessContext.h:16] Deconstructing WindowlessContext
I0406 10:08:32.027352 19727 WindowlessContext.cpp:245] Deconstructing GL context
I0406 10:08:32.047761 19727 Simulator.cpp:62] Loading navmesh from /media/phong/Data2TB/dataset/Matterport/Habitat/v1/tasks/mp3d_habitat/mp3d/X7HyMhZNoso/X7HyMhZNoso.navmesh
I0406 10:08:32.048007 19727 Simulator.cpp:64] Loaded.
I0406 10:08:32.048141 19727 SceneGraph.h:92] Created DrawableGroup: 
Renderer: GeForce RTX 2080 Ti/PCIe/SSE2 by NVIDIA Corporation
OpenGL version: 4.6.0 NVIDIA 435.21
Using optional features:
    GL_ARB_ES2_compatibility
    GL_ARB_direct_state_access
    GL_ARB_get_texture_sub_image
    GL_ARB_invalidate_subdata
    GL_ARB_multi_bind
    GL_ARB_robustness
    GL_ARB_separate_shader_objects
    GL_ARB_texture_filter_anisotropic
    GL_ARB_texture_storage
    GL_ARB_texture_storage_multisample
    GL_ARB_vertex_array_object
    GL_KHR_debug
Using driver workarounds:
    no-layout-qualifiers-on-old-glsl
    nv-zero-context-profile-mask
    nv-implementation-color-read-format-dsa-broken
    nv-cubemap-inconsistent-compressed-image-size
    nv-cubemap-broken-full-compressed-image-query
    nv-compressed-block-size-in-bits
I0406 10:08:32.123594 19727 ResourceManager.cpp:1119] Importing Basis files as BC7
I0406 10:08:34.366274 19727 Simulator.cpp:130] Loading house from /media/phong/Data2TB/dataset/Matterport/Habitat/v1/tasks/mp3d_habitat/mp3d/X7HyMhZNoso/X7HyMhZNoso.house
I0406 10:08:34.366349 19727 Simulator.cpp:136] Loading semantic mesh /media/phong/Data2TB/dataset/Matterport/Habitat/v1/tasks/mp3d_habitat/mp3d/X7HyMhZNoso/X7HyMhZNoso_semantic.ply
I0406 10:08:34.366355 19727 SceneGraph.h:92] Created DrawableGroup: 
I0406 10:08:40.764156 19727 Simulator.cpp:149] Loaded.
I0406 10:08:40.813067 19727 simulator.py:143] Loaded navmesh /media/phong/Data2TB/dataset/Matterport/Habitat/v1/tasks/mp3d_habitat/mp3d/X7HyMhZNoso/X7HyMhZNoso.navmesh
EPISODES A  10
I0406 10:08:40.946849 19727 Simulator.cpp:36] Deconstructing Simulator
I0406 10:08:40.946892 19727 SemanticScene.h:40] Deconstructing SemanticScene
I0406 10:08:40.948513 19727 SceneManager.h:24] Deconstructing SceneManager
I0406 10:08:40.948518 19727 SceneGraph.h:25] Deconstructing SceneGraph
I0406 10:08:40.948561 19727 RenderTarget.h:51] Deconstructing RenderTarget
I0406 10:08:40.949321 19727 Sensor.h:80] Deconstructing Sensor
I0406 10:08:40.949329 19727 RenderTarget.h:51] Deconstructing RenderTarget
I0406 10:08:40.949751 19727 Sensor.h:80] Deconstructing Sensor
I0406 10:08:40.949761 19727 SceneGraph.h:25] Deconstructing SceneGraph
I0406 10:08:40.955967 19727 Renderer.cpp:33] Deconstructing Renderer
I0406 10:08:40.955977 19727 WindowlessContext.h:16] Deconstructing WindowlessContext
I0406 10:08:40.955981 19727 WindowlessContext.cpp:245] Deconstructing GL context
I0406 10:08:40.982967 19727 Simulator.cpp:62] Loading navmesh from /media/phong/Data2TB/dataset/Matterport/Habitat/v1/tasks/mp3d_habitat/mp3d/Z6MFQCViBuw/Z6MFQCViBuw.navmesh
I0406 10:08:40.983465 19727 Simulator.cpp:64] Loaded.
I0406 10:08:40.983618 19727 SceneGraph.h:92] Created DrawableGroup: 
I0406 10:08:41.095933 19727 ResourceManager.cpp:1119] Importing Basis files as BC7
Renderer: GeForce RTX 2080 Ti/PCIe/SSE2 by NVIDIA Corporation
OpenGL version: 4.6.0 NVIDIA 435.21
Using optional features:
    GL_ARB_ES2_compatibility
    GL_ARB_direct_state_access
    GL_ARB_get_texture_sub_image
    GL_ARB_invalidate_subdata
    GL_ARB_multi_bind
    GL_ARB_robustness
    GL_ARB_separate_shader_objects
    GL_ARB_texture_filter_anisotropic
    GL_ARB_texture_storage
    GL_ARB_texture_storage_multisample
    GL_ARB_vertex_array_object
    GL_KHR_debug
Using driver workarounds:
    no-layout-qualifiers-on-old-glsl
    nv-zero-context-profile-mask
    nv-implementation-color-read-format-dsa-broken
    nv-cubemap-inconsistent-compressed-image-size
    nv-cubemap-broken-full-compressed-image-query
    nv-compressed-block-size-in-bits
I0406 10:08:47.203900 19727 Simulator.cpp:130] Loading house from /media/phong/Data2TB/dataset/Matterport/Habitat/v1/tasks/mp3d_habitat/mp3d/Z6MFQCViBuw/Z6MFQCViBuw.house
I0406 10:08:47.204015 19727 Simulator.cpp:136] Loading semantic mesh /media/phong/Data2TB/dataset/Matterport/Habitat/v1/tasks/mp3d_habitat/mp3d/Z6MFQCViBuw/Z6MFQCViBuw_semantic.ply
I0406 10:08:47.204020 19727 SceneGraph.h:92] Created DrawableGroup: 
I0406 10:08:51.339296 19727 Simulator.cpp:149] Loaded.
I0406 10:08:51.390200 19727 simulator.py:143] Loaded navmesh /media/phong/Data2TB/dataset/Matterport/Habitat/v1/tasks/mp3d_habitat/mp3d/Z6MFQCViBuw/Z6MFQCViBuw.navmesh
EPISODES B  10
I0406 10:08:51.597631 19727 Simulator.cpp:36] Deconstructing Simulator
I0406 10:08:51.597692 19727 SemanticScene.h:40] Deconstructing SemanticScene
I0406 10:08:51.599572 19727 SceneManager.h:24] Deconstructing SceneManager
I0406 10:08:51.599578 19727 SceneGraph.h:25] Deconstructing SceneGraph
I0406 10:08:51.599647 19727 RenderTarget.h:51] Deconstructing RenderTarget
I0406 10:08:51.600244 19727 Sensor.h:80] Deconstructing Sensor
I0406 10:08:51.600253 19727 RenderTarget.h:51] Deconstructing RenderTarget
I0406 10:08:51.600458 19727 Sensor.h:80] Deconstructing Sensor
I0406 10:08:51.600469 19727 SceneGraph.h:25] Deconstructing SceneGraph
I0406 10:08:51.608188 19727 Renderer.cpp:33] Deconstructing Renderer
I0406 10:08:51.608198 19727 WindowlessContext.h:16] Deconstructing WindowlessContext
I0406 10:08:51.608201 19727 WindowlessContext.cpp:245] Deconstructing GL context
I0406 10:08:51.625839 19727 Simulator.cpp:62] Loading navmesh from /media/phong/Data2TB/dataset/Matterport/Habitat/v1/tasks/mp3d_habitat/mp3d/QUCTc6BB5sX/QUCTc6BB5sX.navmesh
I0406 10:08:51.626281 19727 Simulator.cpp:64] Loaded.
I0406 10:08:51.626430 19727 SceneGraph.h:92] Created DrawableGroup: 
Renderer: GeForce RTX 2080 Ti/PCIe/SSE2 by NVIDIA Corporation
OpenGL version: 4.6.0 NVIDIA 435.21
Using optional features:
    GL_ARB_ES2_compatibility
    GL_ARB_direct_state_access
    GL_ARB_get_texture_sub_image
    GL_ARB_invalidate_subdata
    GL_ARB_multi_bind
    GL_ARB_robustness
    GL_ARB_separate_shader_objects
    GL_ARB_texture_filter_anisotropic
    GL_ARB_texture_storage
    GL_ARB_texture_storage_multisample
    GL_ARB_vertex_array_object
    GL_KHR_debug
Using driver workarounds:
    no-layout-qualifiers-on-old-glsl
    nv-zero-context-profile-mask
    nv-implementation-color-read-format-dsa-broken
    nv-cubemap-inconsistent-compressed-image-size
    nv-cubemap-broken-full-compressed-image-query
    nv-compressed-block-size-in-bits
I0406 10:08:51.675937 19727 ResourceManager.cpp:1119] Importing Basis files as BC7
I0406 10:08:56.669844 19727 Simulator.cpp:130] Loading house from /media/phong/Data2TB/dataset/Matterport/Habitat/v1/tasks/mp3d_habitat/mp3d/QUCTc6BB5sX/QUCTc6BB5sX.house
I0406 10:08:56.669992 19727 Simulator.cpp:136] Loading semantic mesh /media/phong/Data2TB/dataset/Matterport/Habitat/v1/tasks/mp3d_habitat/mp3d/QUCTc6BB5sX/QUCTc6BB5sX_semantic.ply
I0406 10:08:56.669998 19727 SceneGraph.h:92] Created DrawableGroup: 
I0406 10:09:06.969951 19727 Simulator.cpp:149] Loaded.
I0406 10:09:07.064879 19727 simulator.py:143] Loaded navmesh /media/phong/Data2TB/dataset/Matterport/Habitat/v1/tasks/mp3d_habitat/mp3d/QUCTc6BB5sX/QUCTc6BB5sX.navmesh
RESETTING 10 to 10 

  0%|          | 0/3600 [00:00<?, ?it/s]/home/phong/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/nn/functional.py:2506: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
  "See the documentation of nn.Upsample for details.".format(mode))
Warning : not backpropagating through the projection -- is this what you want??
  0%|          | 0/3600 [00:02<?, ?it/s]
Traceback (most recent call last):
  File "/home/phong/data/Work/Paper3/Code/synsin/evaluation/eval.py", line 75, in check_initial_batch
    np.loadtxt('/home/phong/data/Work/Paper3/Code/synsin/data/files/eval_cached_cameras_mp3d.txt'))
  File "/home/phong/anaconda3/envs/pytorch/lib/python3.6/site-packages/numpy/testing/_private/utils.py", line 1533, in assert_allclose
    verbose=verbose, header=header, equal_nan=equal_nan)
  File "/home/phong/anaconda3/envs/pytorch/lib/python3.6/site-packages/numpy/testing/_private/utils.py", line 846, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Not equal to tolerance rtol=1e-07, atol=0

Mismatched elements: 96 / 128 (75%)
Max absolute difference: 38.9685936
Max relative difference: 89.41226322
 x: array([-7.876723e-03, -5.965701e-02, -9.981878e-01, -1.659706e+01,
       -3.896221e-02,  9.974791e-01, -5.930720e-02,  1.113027e+00,
        9.992096e-01,  3.842445e-02, -1.018124e-02, -2.654723e+00,...
 y: array([ 6.228155e-01,  1.615186e-02,  7.822020e-01,  1.141124e+01,
        6.692571e-02,  9.950223e-01, -7.383493e-02, -2.435736e+00,
       -7.795010e-01,  9.833497e-02,  6.186343e-01,  8.109766e+00,...

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/phong/data/Work/Paper3/Code/synsin/evaluation/eval.py", line 203, in <module>
    check_initial_batch(batch, test_ops.dataset)
  File "/home/phong/data/Work/Paper3/Code/synsin/evaluation/eval.py", line 78, in check_initial_batch
    \n\nYour results will NOT be comparable with results in the paper or online.")
Exception: 

There is an error with your setup or options.             

Your results will NOT be comparable with results in the paper or online.
I0406 10:09:10.500044 19727 Simulator.cpp:36] Deconstructing Simulator
I0406 10:09:10.500248 19727 SemanticScene.h:40] Deconstructing SemanticScene
I0406 10:09:10.506703 19727 SceneManager.h:24] Deconstructing SceneManager
I0406 10:09:10.506712 19727 SceneGraph.h:25] Deconstructing SceneGraph
I0406 10:09:10.506816 19727 RenderTarget.h:51] Deconstructing RenderTarget
I0406 10:09:10.508659 19727 Sensor.h:80] Deconstructing Sensor
I0406 10:09:10.508671 19727 RenderTarget.h:51] Deconstructing RenderTarget
I0406 10:09:10.509035 19727 Sensor.h:80] Deconstructing Sensor
I0406 10:09:10.509048 19727 SceneGraph.h:25] Deconstructing SceneGraph
I0406 10:09:10.523064 19727 Renderer.cpp:33] Deconstructing Renderer
I0406 10:09:10.523079 19727 WindowlessContext.h:16] Deconstructing WindowlessContext
I0406 10:09:10.523083 19727 WindowlessContext.cpp:245] Deconstructing GL context

Process finished with exit code 1

So i guess the problem is in this line https://github.com/facebookresearch/synsin/blob/82ff948f91a779188c467922c8f5144018b40ac8/evaluation/eval.py#L74 where you are trying to compare the pose of the first item in the batch with a cached pose from a txt file. In my case, it doesnt seems to match.

The only change is that I have to edit the opts.config since you hardcoded it https://github.com/facebookresearch/synsin/blob/82ff948f91a779188c467922c8f5144018b40ac8/evaluation/eval.py#L119 as your own. This is my config: opts.config = '/home/phong/data/Work/Paper3/Libraries/habitat-api/configs/tasks/pointnav_rgbd.yaml'

When I tried to comment out the checking function https://github.com/facebookresearch/synsin/blob/82ff948f91a779188c467922c8f5144018b40ac8/evaluation/eval.py#L202 then I can run the evaluation code but I got worse result than yours in both paper and this repo. Is there anyway to fix this ?

oawiles commented 4 years ago

Sorry that Matterport is a pain -- we would have released the images but weren't allowed to If the check is failing it means the images being generated on the fly are not the ones we used, so the numbers you get when you comment out the line are not comparable (and this is what I would expect -- hence having the check).

You have two choices:

  1. You could just use the new set of images (but then please run an evaluation on KITTI or the RealEstate dataset to ensure that your version of pytorch is running the models correctly)

  2. Try to diagnose why you're getting different generated images. My hunch is that it's because you're not loading in the dataset splits correctly. These splits are https://github.com/facebookresearch/synsin/tree/master/data/scene_episodes and they decide the environment to load in. These splits are generated if they are not found here, so the code would still run but the splits would be wrong. I would check that the right splits are being found in that part of the code. I hope that helps!

ronghanghu commented 3 years ago

I also encountered this error, and I figured out that this was a habitat version issue.

After switching back to commits

habitat-sim: d383c2011bf1baab2ce7b3cd40aea573ad2ddf71
habitat-api: e94e6f3953fcfba4c29ee30f65baa52d6cea716e

as mentioned in https://github.com/facebookresearch/synsin/issues/2#issuecomment-605827875, now the evaluation runs as expected.