luciddreamer-cvlab/LucidDreamer

An error occurs when running colab

Closed this issue · 3 comments

When I clicked on the "Running on public URL" link, I clicked on the example below and entered the default images and parameters, but it didn't work.

The error output is:

Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/gradio/queueing.py", line 495, in call_prediction
output = await route_utils.call_process_api(
File "/usr/local/lib/python3.10/dist-packages/gradio/route_utils.py", line 232, in call_process_api
output = await app.get_blocks().process_api(
File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1561, in process_api
result = await self.call_function(
File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1179, in call_function
prediction = await anyio.to_thread.run_sync(
File "/usr/local/lib/python3.10/dist-packages/anyio/to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 807, in run
result = context.run(func, *args)
File "/usr/local/lib/python3.10/dist-packages/gradio/utils.py", line 678, in wrapper
response = f(*args, **kwargs)
File "/content/LucidDreamer-Gaussian/luciddreamer.py", line 61, in run
gaussians, default_gallery = self.create(rgb_cond, txt_cond, neg_txt_cond, pcdgenpath, seed, diff_steps)
File "/content/LucidDreamer-Gaussian/luciddreamer.py", line 66, in create
self.traindata = self.generate_pcd(rgb_cond, txt_cond, neg_txt_cond, pcdgenpath, seed, diff_steps)
File "/content/LucidDreamer-Gaussian/luciddreamer.py", line 187, in generate_pcd
depth_curr = self.d.infer_pil(image_curr)
File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/content/LucidDreamer-Gaussian/./ZoeDepth/zoedepth/models/depth_model.py", line 141, in infer_pil
out_tensor = self.infer(x, pad_input=pad_input, with_flip_aug=with_flip_aug, **kwargs)
File "/content/LucidDreamer-Gaussian/./ZoeDepth/zoedepth/models/depth_model.py", line 126, in infer
return self.infer_with_flip_aug(x, pad_input=pad_input, **kwargs)
File "/content/LucidDreamer-Gaussian/./ZoeDepth/zoedepth/models/depth_model.py", line 110, in infer_with_flip_aug
out = self._infer_with_pad_aug(x, pad_input=pad_input, **kwargs)
File "/content/LucidDreamer-Gaussian/./ZoeDepth/zoedepth/models/depth_model.py", line 88, in _infer_with_pad_aug
out = self._infer(x)
File "/content/LucidDreamer-Gaussian/./ZoeDepth/zoedepth/models/depth_model.py", line 55, in _infer
return self(x)['metric_depth']
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/content/LucidDreamer-Gaussian/./ZoeDepth/zoedepth/models/zoedepth/zoedepth_v1.py", line 144, in forward
rel_depth, out = self.core(x, denorm=denorm, return_rel_depth=True)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/content/LucidDreamer-Gaussian/./ZoeDepth/zoedepth/models/base_models/midas.py", line 262, in forward
x = self.prep(x)
File "/content/LucidDreamer-Gaussian/./ZoeDepth/zoedepth/models/base_models/midas.py", line 186, in call
return self.normalization(self.resizer(x))
File "/content/LucidDreamer-Gaussian/./ZoeDepth/zoedepth/models/base_models/midas.py", line 173, in call
return nn.functional.interpolate(x, (height, width), mode='bilinear', align_corners=True)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/functional.py", line 3924, in interpolate
raise TypeError(
TypeError: expected size to be one of int or Tuple[int] or Tuple[int, int] or Tuple[int, int, int], but got size with types [<class 'numpy.int64'>, <class 'numpy.int64'>]

Thanks for your reply@philtsip, it solved my problem perfectly.

The problem is with the colab link in the readme interface

"! sed -i 's/(new_height, new_width)/int(new_height), int(new_width)/g' /content/LucidDreamer-Gaussian/ZoeDepth/zoedepth/models/base_models/midas.py”

This statement is wrong, we need to change the height and width positions in this statement

Hello, I am happy to hear that the issue is solved.
Please re-open the issue if you meet any problems or errors.