-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Recent change in local_visualizer.py causes error on Windows #2833
Comments
I have the same bug in Window platform. Do you know how to fix it? Thank you, |
Thanks for your reminder, we'll re-test on windows and fix this! |
I got the same bug on Windows platform. |
Now I got the same bug on Linux: |
I've got the same bug, does anyone know how to fix this? Thanks! |
Did you try out one of the workarounds that I suggested above? For now, you could either try setting up an environment variable named DISPLAY or remove the if-clause in the code chunk that I linked. In my case, the error occurred because the following lines 181 and 182 were not executed if this variable is not present. Be aware that setting up a DISPLAY environment variable might have undesired side effects with other programs that try to read it, so it's really just a workaround. |
As you said, remove the if-clause is working! Appreciate for your help, Thank hou! |
File "demo/pcd_demo.py", line 90, in |
Thank you @MatthiasHinz for mentioning the issue and suggesting a workaround. I followed your suggestion by commenting out line 180.
Additionally, I had to make some changes to the
|
Can I See your local_visualizer.py? I still can't run it |
I got the same bug on Windows platform. |
this bug still exists in mmdet3D v1.4.0 which is released recently |
same bug |
import os |
Prerequisite
Task
I'm using the official example scripts/configs for the officially supported tasks/models/datasets.
Branch
main branch https://github.com/open-mmlab/mmdetection3d
Environment
sys.platform: win32
Python: 3.9.16 | packaged by conda-forge | (main, Feb 1 2023, 21:28:38) [MSC v.1929 64 bit (AMD64)]
CUDA available: True
numpy_random_seed: 2147483648
GPU 0: NVIDIA GeForce RTX 3080 Ti
CUDA_HOME: C:\ProgramData\Anaconda3\envs\mmdetection
NVCC: Cuda compilation tools, release 11.6, V11.6.124
GCC: n/a
PyTorch: 1.12.0
PyTorch compiling details: PyTorch built with:
TorchVision: 0.13.0
OpenCV: 4.7.0
MMEngine: 0.8.4
MMDetection: 3.0.0
MMDetection3D: 1.3.0+b84ba5a
spconv2.0: True
Reproduces the problem - code sample
Reproduces the problem - command or script
python mmdetection3d/tools/misc/browse_dataset.py .\configs_base_\datasets\kitti-3d-3class.py --task lidar_det --output-dir .\data\kitti\ --show-interval 30
Reproduces the problem - error message
Traceback (most recent call last):
File "E:\mmdetection3d\tools\misc\browse_dataset.py", line 152, in
main()
File "E:\mmdetection3d\tools\misc\browse_dataset.py", line 138, in main
visualizer.add_datasample(
File "C:\ProgramData\Anaconda3\envs\mmstone\lib\site-packages\mmengine\dist\utils.py", line 401, in wrapper
return func(*args, **kwargs)
File "E:\mmdetection3d\mmdet3d\visualization\local_visualizer.py", line 1082, in add_datasample
self.show(
File "C:\ProgramData\Anaconda3\envs\mmstone\lib\site-packages\mmengine\dist\utils.py", line 401, in wrapper
return func(*args, **kwargs)
File "E:\mmdetection3d\mmdet3d\visualization\local_visualizer.py", line 868, in show
self.view_control.convert_to_pinhole_camera_parameters() # noqa: E501
AttributeError: 'Det3DLocalVisualizer' object has no attribute 'view_control'
Additional information
Hello,
a recent change in the file local_visualizer.py requires that the environment variable DISPLAY exists in order to initialize the Open3d visualizer backend. Since Windows desktops do usually not set a DISPLAY variable, calls to the Det3DLocalVisualizer e.g. with the browse_dataset script, will terminate with the fatal exception shown above.
See: https://github.com/open-mmlab/mmdetection3d/blame/5c0613be29bd2e51771ec5e046d89ba3089887c7/mmdet3d/visualization/local_visualizer.py#L180
The browse_dataset will work normally again after either removing the if-condition or setting up a DISPLAY variable with any value. However, I think it would be good to rework the code section for system compatibility.
The text was updated successfully, but these errors were encountered: