(venv) tohid@Tohids-MacBook-Air ssdl % python3 main.py Traceback (most recent call…
- User
(venv) tohid@Tohids-MacBook-Air ssdl % python3 main.py
Traceback (most recent call last): File "/Users/tohid/Documents/NAS/ssdl/main.py", line 3, in import torch File "/Users/tohid/Documents/NAS/ssdl/venv/lib/python3.11/site-packages/torch/init.py", line 408, in _load_global_deps() File "/Users/tohid/Documents/NAS/ssdl/venv/lib/python3.11/site-packages/torch/init.py", line 364, in _load_global_deps raise err File "/Users/tohid/Documents/NAS/ssdl/venv/lib/python3.11/site-packages/torch/init.py", line 312, in _load_global_deps ctypes.CDLL(global_deps_lib_path, mode=ctypes.RTLD_GLOBAL) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ctypes/init.py", line 376, in init self._handle = _dlopen(self._name, mode) ^^^^^^^^^^^^^^^^^^^^^^^^^ OSError: dlopen(/Users/tohid/Documents/NAS/ssdl/venv/lib/python3.11/site-packages/torch/lib/libtorch_global_deps.dylib, 0x000A): tried: '/Users/tohid/Documents/NAS/ssdl/venv/lib/python3.11/site-packages/torch/lib/libtorch_global_deps.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/tohid/Documents/NAS/ssdl/venv/lib/python3.11/site-packages/torch/lib/libtorch_global_deps.dylib' (no such file), '/Users/tohid/Documents/NAS/ssdl/venv/lib/python3.11/site-packages/torch/lib/libtorch_global_deps.dylib' (no such file) Assistant
It looks like you're encountering an issue with PyTorch installation. The error shows that Python can't find the
libtorch_global_deps.dylibfile that PyTorch needs to run.This is typically caused by an incomplete or corrupted PyTorch installation. Since you're on a Mac (I can see from the path and .dylib extension), here's how to fix it:
# First, deactivate and reactivate your virtual environment deactivate source venv/bin/activate # Then reinstall PyTorch with the correct version for Mac pip uninstall -y torch pip install torch torchvision torchaudioIf you need a specific version of PyTorch or CUDA support, you might want to use the command from PyTorch's website that matches your system requirements.
Would you like me to explain more about what caused this error or help troubleshoot further?
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.