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

DirectML run fail on some cases. #645

Open
DeruVN opened this issue Sep 12, 2024 · 0 comments
Open

DirectML run fail on some cases. #645

DeruVN opened this issue Sep 12, 2024 · 0 comments

Comments

@DeruVN
Copy link

DeruVN commented Sep 12, 2024

Hi
DirectML run well sometimes, but on some performance it give errors.
(Always error with some images input, some other is always ok. Beside that all test images works fine with nvidia vga)

Another strange thing. After several errors, I can't do "import torch" in python.exe again, have to re-install torch. Maybe directml changed something in lib.

Please take a look.

image

Traceback (most recent call last):
File "D:\anaconda3\Depth-Anything-V2\run.py", line 60, in
depth = depth_anything.infer_image(raw_image, args.input_size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\anaconda3\Lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "D:\anaconda3\Depth-Anything-V2\depth_anything_v2\dpt.py", line 191, in infer_image
depth = self.forward(image)
^^^^^^^^^^^^^^^^^^^
File "D:\anaconda3\Depth-Anything-V2\depth_anything_v2\dpt.py", line 180, in forward
features = self.pretrained.get_intermediate_layers(x, self.intermediate_layer_idx[self.encoder], return_class_token=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\anaconda3\Depth-Anything-V2\depth_anything_v2\dinov2.py", line 309, in get_intermediate_layers
outputs = self._get_intermediate_layers_not_chunked(x, n)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\anaconda3\Depth-Anything-V2\depth_anything_v2\dinov2.py", line 278, in _get_intermediate_layers_not_chunked
x = blk(x)
^^^^^^
File "D:\anaconda3\Lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\anaconda3\Lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\anaconda3\Depth-Anything-V2\depth_anything_v2\dinov2_layers\block.py", line 248, in forward
return super().forward(x_or_x_list)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\anaconda3\Depth-Anything-V2\depth_anything_v2\dinov2_layers\block.py", line 106, in forward
x = x + attn_residual_func(x)
^^^^^^^^^^^^^^^^^^^^^
File "D:\anaconda3\Depth-Anything-V2\depth_anything_v2\dinov2_layers\block.py", line 85, in attn_residual_func
return self.ls1(self.attn(self.norm1(x)))
^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\anaconda3\Lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\anaconda3\Lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\anaconda3\Depth-Anything-V2\depth_anything_v2\dinov2_layers\attention.py", line 69, in forward
return super().forward(x)
^^^^^^^^^^^^^^^^^^
File "D:\anaconda3\Depth-Anything-V2\depth_anything_v2\dinov2_layers\attention.py", line 54, in forward
attn = q @ k.transpose(-2, -1)
~~^~~~~~~~~~~~~~~~~~~~~
RuntimeError: The parameter is incorrect.

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

1 participant