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

python demo.py, click run found error #84

Open
CUITCHENSIYU opened this issue Apr 18, 2024 · 1 comment
Open

python demo.py, click run found error #84

CUITCHENSIYU opened this issue Apr 18, 2024 · 1 comment

Comments

@CUITCHENSIYU
Copy link

Hello, may I know the reason behind this error?

python3 demo.py --weights checkpoints/DUSt3R_ViTLarge_BaseDecoder_512_dpt.pth

Traceback (most recent call last):
File "/home/csy/anaconda3/envs/mmlab/lib/python3.8/site-packages/gradio/queueing.py", line 495, in call_prediction
output = await route_utils.call_process_api(
File "/home/csy/anaconda3/envs/mmlab/lib/python3.8/site-packages/gradio/route_utils.py", line 232, in call_process_api
output = await app.get_blocks().process_api(
File "/home/csy/anaconda3/envs/mmlab/lib/python3.8/site-packages/gradio/blocks.py", line 1561, in process_api
result = await self.call_function(
File "/home/csy/anaconda3/envs/mmlab/lib/python3.8/site-packages/gradio/blocks.py", line 1179, in call_function
prediction = await anyio.to_thread.run_sync(
File "/home/csy/anaconda3/envs/mmlab/lib/python3.8/site-packages/anyio/to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/home/csy/anaconda3/envs/mmlab/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "/home/csy/anaconda3/envs/mmlab/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 867, in run
result = context.run(func, *args)
File "/home/csy/anaconda3/envs/mmlab/lib/python3.8/site-packages/gradio/utils.py", line 678, in wrapper
response = f(*args, **kwargs)
File "demo.py", line 142, in get_reconstructed_scene
scene = global_aligner(output, device=device, mode=mode, verbose=not silent)
File "/mnt/gpuserver-1-disk0-nfs/chensiyu/dust3r/dust3r/cloud_opt/init.py", line 29, in global_aligner
net = PairViewer(view1, view2, pred1, pred2, **optim_kw).to(device)
File "/mnt/gpuserver-1-disk0-nfs/chensiyu/dust3r/dust3r/cloud_opt/pair_viewer.py", line 25, in init
super().init(*args, **kwargs)
File "/mnt/gpuserver-1-disk0-nfs/chensiyu/dust3r/dust3r/cloud_opt/base_opt.py", line 42, in init
self._init_from_views(*args, **kwargs)
File "/mnt/gpuserver-1-disk0-nfs/chensiyu/dust3r/dust3r/cloud_opt/base_opt.py", line 69, in init_from_views
self.pred_i = NoGradParamDict({ij: pred1_pts[n] for n, ij in enumerate(self.str_edges)})
File "/mnt/gpuserver-1-disk0-nfs/chensiyu/dust3r/dust3r/cloud_opt/commons.py", line 30, in NoGradParamDict
return nn.ParameterDict(x).requires_grad
(False)
File "/home/csy/anaconda3/envs/mmlab/lib/python3.8/site-packages/torch/nn/modules/container.py", line 593, in init
self.update(parameters)
File "/home/csy/anaconda3/envs/mmlab/lib/python3.8/site-packages/torch/nn/modules/container.py", line 724, in update
self[key] = parameter
File "/home/csy/anaconda3/envs/mmlab/lib/python3.8/site-packages/torch/nn/modules/container.py", line 604, in setitem
self.register_parameter(key, parameter)
File "/home/csy/anaconda3/envs/mmlab/lib/python3.8/site-packages/torch/nn/modules/module.py", line 358, in register_parameter
raise TypeError("cannot assign '{}' object to parameter '{}' "

@yocabon
Copy link
Contributor

yocabon commented Apr 18, 2024

Hi, could you tell me a little more ?

How many images did you add ?
Do you get this error every time ? -> if yes What if you use more than 3 images, do you still get an error ?

from what I gather:
it crashed during the initialization of
PairViewer -> so 1 or 2 images
self.pred_i = NoGradParamDict({ij: pred1_pts[n] for n, ij in enumerate(self.str_edges)}) -> at this line in the parent class
str_edges was empty ?, it shouldn't be.

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

2 participants