Skip to content
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

KeyError: 'CameraMessage' #3571

Open
yanyide123 opened this issue Jan 14, 2025 · 6 comments
Open

KeyError: 'CameraMessage' #3571

yanyide123 opened this issue Jan 14, 2025 · 6 comments

Comments

@yanyide123
Copy link

error message:
connection handler failed
Traceback (most recent call last):
File "D:\miniconda3\envs\nerfstudio\lib\site-packages\websockets\legacy\server.py", line 236, in handler
await self.ws_handler(self)
File "D:\miniconda3\envs\nerfstudio\lib\site-packages\viser\infra_infra.py", line 379, in serve
await asyncio.gather(
File "D:\miniconda3\envs\nerfstudio\lib\site-packages\viser\infra_infra.py", line 533, in _message_consumer
message = message_class.deserialize(raw)
File "D:\miniconda3\envs\nerfstudio\lib\site-packages\viser\infra_messages.py", line 149, in deserialize
message_type = cls._subclass_from_type_string()[cast(str, mapping.pop("type"))]
KeyError: 'CameraMessage'
Printed the mapping, mapping result.
mapping {'type': 'CameraMessage', 'aspect': 1.7392638036809815, 'render_aspect': 1.7777777777777777, 'fov': 50, 'matrix': (0.7071067811865476, 0.7071067
811865475, 0, 0, -0.20507577810739902, 0.20507577810739896, 0.9570202978345286, 0, 0.6767155423319645, -0.6767155423319646, 0.29002094671369916, 0, 0.69
99999999999997, -0.6999999999999998, 0.29999999999999993, 1), 'camera_type': 'perspective', 'is_moving': False, 'timestamp': 1736837390932.0}

The source of the error is:
Startup command:ns-train nerfacto --data data/nerfstudio/poster --viewer.websocket-port 9000
Then access through: https://viewer.nerf.studio/?websocket_url=ws://localhost:9000
The error occurs as soon as the connection is made.

@brentyi
Copy link
Collaborator

brentyi commented Jan 14, 2025

Hi, can you check if #2972 answers your question?

@yanyide123
Copy link
Author

I have tried it, but it didn't solve my problem.

@brentyi
Copy link
Collaborator

brentyi commented Jan 14, 2025

Do you still get the CameraMessage KeyError when you follow #2972 (comment)?

@engrmusawarali71
Copy link

engrmusawarali71 commented Jan 14, 2025

Hello, you should run on local host, if you want to run your code on legacy visualizer then you should add the line --vis viewer_legacy. Write the command ns-train nerfacto --data data/nerfstudio/poster --viewer.websocket-port 9000 --vis viewer_legacy

@yanyide123
Copy link
Author

Hello, you should run on local host, if you want to run your code on legacy visualizer then you should add the line --vis viewer_legacy. Write the command ns-train nerfacto --data data/nerfstudio/poster --viewer.websocket-port 9000 --vis viewer_legacy

Thank you, your solution solved my problem.

@yanyide123
Copy link
Author

Do you still get the CameraMessage KeyError when you follow #2972 (comment)?

ns-train nerfacto --data data/nerfstudio/poster --viewer.websocket-port 9000 --vis viewer_legacy

Thank you. The above command resolved my issue on Windows 10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants