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

Gradio app works for the example images, fails for any other image(s) #42

Open
SoftologyPro opened this issue Jan 28, 2024 · 2 comments

Comments

@SoftologyPro
Copy link

Running the gradio app locally on Windows under it's own virtual enviroment.
It starts fine and the examples work.
When I select another image (example attached) I get this error...

Traceback (most recent call last):
  File "D:\Tests\LucidDreamer\voc_luciddreamer\lib\site-packages\gradio\queueing.py", line 489, in call_prediction
    output = await route_utils.call_process_api(
  File "D:\Tests\LucidDreamer\voc_luciddreamer\lib\site-packages\gradio\route_utils.py", line 232, in call_process_api
    output = await app.get_blocks().process_api(
  File "D:\Tests\LucidDreamer\voc_luciddreamer\lib\site-packages\gradio\blocks.py", line 1561, in process_api
    result = await self.call_function(
  File "D:\Tests\LucidDreamer\voc_luciddreamer\lib\site-packages\gradio\blocks.py", line 1179, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "D:\Tests\LucidDreamer\voc_luciddreamer\lib\site-packages\anyio\to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
  File "D:\Tests\LucidDreamer\voc_luciddreamer\lib\site-packages\anyio\_backends\_asyncio.py", line 2134, in run_sync_in_worker_thread
    return await future
  File "D:\Tests\LucidDreamer\voc_luciddreamer\lib\site-packages\anyio\_backends\_asyncio.py", line 851, in run
    result = context.run(func, *args)
  File "D:\Tests\LucidDreamer\voc_luciddreamer\lib\site-packages\gradio\utils.py", line 678, in wrapper
    response = f(*args, **kwargs)
  File "D:\Tests\LucidDreamer\luciddreamer.py", line 170, in run
    gaussians = self.create(
  File "D:\Tests\LucidDreamer\luciddreamer.py", line 187, in create
    self.traindata = self.generate_pcd(rgb_cond, txt_cond, neg_txt_cond, pcdgenpath, seed, diff_steps)
  File "D:\Tests\LucidDreamer\luciddreamer.py", line 352, in generate_pcd
    depth_curr = self.d(image_curr)
  File "D:\Tests\LucidDreamer\luciddreamer.py", line 157, in d
    return self.d_model.infer_pil(im)
  File "D:\Tests\LucidDreamer\voc_luciddreamer\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "D:\Tests\LucidDreamer\./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 "D:\Tests\LucidDreamer\./ZoeDepth\zoedepth\models\depth_model.py", line 126, in infer
    return self.infer_with_flip_aug(x, pad_input=pad_input, **kwargs)
  File "D:\Tests\LucidDreamer\./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 "D:\Tests\LucidDreamer\./ZoeDepth\zoedepth\models\depth_model.py", line 88, in _infer_with_pad_aug
    out = self._infer(x)
  File "D:\Tests\LucidDreamer\./ZoeDepth\zoedepth\models\depth_model.py", line 55, in _infer
    return self(x)['metric_depth']
  File "D:\Tests\LucidDreamer\voc_luciddreamer\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "D:\Tests\LucidDreamer\voc_luciddreamer\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
  File "D:\Tests\LucidDreamer\./ZoeDepth\zoedepth\models\zoedepth\zoedepth_v1.py", line 144, in forward
    rel_depth, out = self.core(x, denorm=denorm, return_rel_depth=True)
  File "D:\Tests\LucidDreamer\voc_luciddreamer\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "D:\Tests\LucidDreamer\voc_luciddreamer\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
  File "D:\Tests\LucidDreamer\./ZoeDepth\zoedepth\models\base_models\midas.py", line 262, in forward
    x = self.prep(x)
  File "D:\Tests\LucidDreamer\./ZoeDepth\zoedepth\models\base_models\midas.py", line 186, in __call__
    return self.normalization(self.resizer(x))
  File "D:\Tests\LucidDreamer\./ZoeDepth\zoedepth\models\base_models\midas.py", line 173, in __call__
    return nn.functional.interpolate(x, (height, width), mode='bilinear', align_corners=True)
  File "D:\Tests\LucidDreamer\voc_luciddreamer\lib\site-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.int32'>, <class 'numpy.int32'>]

MonaLisaColorLarger

@Oclysh
Copy link

Oclysh commented Mar 13, 2024

Perhaps you can convert the format of 'height' and 'width' to int in a function of 'n.function.interpolate'.

@Haimzis
Copy link

Haimzis commented Apr 14, 2024

@SoftologyPro
Could you please share your environment? I also tried running their examples but only received noisy outputs.

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