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

detect_objects.py can't load torch's c10_cuda.dll or one of its dependencies #116

Open
Pap1956 opened this issue Jan 3, 2025 · 1 comment

Comments

@Pap1956
Copy link
Contributor

Pap1956 commented Jan 3, 2025

I copied depth_map script to my launch directory and then opened a project in Metashape.

It installed all requirements without error but when i run the script it stops with error shown in following log:

2025-01-02 22:25:47 Agisoft Metashape Professional Version: 2.2.0 build 19853 (64 bit)

2025-01-02 22:25:47 Platform: Windows

2025-01-02 22:25:47 CPU: 13th Gen Intel(R) Core(TM) i7-13650HX

2025-01-02 22:25:47 CPU family: 6 model: 183 signature: B0671h

2025-01-02 22:25:47 RAM: 31.6 GB

2025-01-02 22:25:48 OpenGL Vendor: NVIDIA Corporation

2025-01-02 22:25:48 OpenGL Renderer: NVIDIA GeForce RTX 4050 Laptop GPU/PCIe/SSE2

2025-01-02 22:25:48 OpenGL Version: 4.6.0 NVIDIA 566.36

2025-01-02 22:25:48 Maximum Texture Size: 32768

2025-01-02 22:25:48 Quad Buffered Stereo: not enabled

2025-01-02 22:25:48 ARB_vertex_buffer_object: supported

2025-01-02 22:25:48 ARB_texture_non_power_of_two: supported

2025-01-02 22:25:49 To execute this script press Scripts/Detect objects

2025-01-02 22:29:27 LoadProject: path = E:/respaldo/paul.pelletier/Downloads/Mavic3/huerta.psx

2025-01-02 22:29:27 Loading project...

2025-01-02 22:29:27 loaded project in 0.439 sec

2025-01-02 22:29:27 Finished processing in 0.443 sec (exit code 1)

2025-01-02 22:29:52 Shape layer: key=0, label=Huerta, enabled=True

2025-01-02 22:29:52 Shape layer: key=1, label=Huerta_10m buf, enabled=True

2025-01-02 22:29:52 Shape layer: key=3, label=Seamlines, enabled=False

2025-01-02 22:29:52 Shape layer: key=4, label=Train zones, enabled=True

2025-01-02 22:29:52 Shape layer: key=5, label=Train data, enabled=True

2025-01-02 22:30:00 Using resolution 0.01999907050291272 m/pix with patch 1600x1600

2025-01-02 22:30:00 Additional neural network training expected on key=5 layer data w.r.t. key=4 layer zones

2025-01-02 22:30:00 Loading train shapes...

2025-01-02 22:30:00 1 train zones and 41 train data loaded in 0.00 sec

2025-01-02 22:30:00 Working dir: E:\respaldo\paul.pelletier\Downloads\Mavic3\objects_detection

2025-01-02 22:30:03 Traceback (most recent call last):

2025-01-02 22:30:03 File "C:/Users/Admin/AppData/Local/Agisoft/Metashape Pro/scripts/detect_objects.py", line 1266, in

2025-01-02 22:30:03 QtCore.QObject.connect(self.btnRun, QtCore.SIGNAL("clicked()"), lambda: self.process())

2025-01-02 22:30:03 File "C:/Users/Admin/AppData/Local/Agisoft/Metashape Pro/scripts/detect_objects.py", line 268, in process

2025-01-02 22:30:03 self.prepair()

2025-01-02 22:30:03 File "C:/Users/Admin/AppData/Local/Agisoft/Metashape Pro/scripts/detect_objects.py", line 343, in prepair

2025-01-02 22:30:03 import torch

2025-01-02 22:30:03 File "C:\Program Files\Agisoft\Metashape Pro\python\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature_.py", line 142, in _import

2025-01-02 22:30:03 return original_import(name, *args, **kwargs)

2025-01-02 22:30:03 File "C:\Users\Admin\AppData\Local\Agisoft\Metashape Pro\user-packages-py39\Python39\site-packages\torch_init_.py", line 124, in

2025-01-02 22:30:03 raise err

2025-01-02 22:30:03 OSError: [WinError 127] La procédure spécifiée est introuvable. Error loading "C:\Users\Admin\AppData\Local\Agisoft\Metashape Pro\user-packages-py39\Python39\site-packages\torch\lib\c10_cuda.dll" or one of its dependencies.

Any suggestion?

@PolarNick239
Copy link
Member

Hi, Paulo! Sorry for the inconvenience.

The problem seems to be caused by a conflict between the python's torch dlls c10.dll, torch.dll, torch_cpu.dll and their duplicates in the Metashape 2.2 installation directory. Unfortunately I couldn't find a simple workaround.

Metashape 2.1 didn't bundle these dlls, so everything works. Probably usage of the script in Metashape 2.1 is the only option at the moment (note that you also need to change the version check of in the script or download its 2.1 version).

We will try to find a solution in future Metashape releases.

@PolarNick239 PolarNick239 changed the title Error running deptrh_map detect_objects.py can't load torch's c10_cuda.dll or one of its dependencies Jan 7, 2025
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