ImportError: cannot import name 'TryExcept' from 'utils' (/HOME/scz5178/.conda/envs/yolo-py38/lib/python3.8/site-packages/utils/__init__.py)
时间: 2023-08-15 09:04:45 浏览: 709
引用\[1\]:ImportError: /usr/local/anaconda3/envs/py38/lib/python3.8/site-packages/mmcv/_ext.cpython-38-x86_64-linux-gnu.so: undefined symbol: Z27points_in_boxes_cpu_forwardN2at6TensorES0_S0 。 引用\[2\]:然后修改报错位置的maxvit.py文件,在我这里也就是“/root/miniconda3/envs/clip/lib/python3.7/site-packages/torchvision/models/maxvit.py”,不从typing中导入OrderedDict模块,而是从typing_extensions中导入 。 引用\[3\]:这个是错误之一,有时可能还是: ImportError: libtorch_cuda_cu.so: cannot open shared object file: No such file or directory 。
问题:ImportError: cannot import name 'TryExcept' from 'utils' (/HOME/scz5178/.conda/envs/yolo-py38/lib/python3.8/site-packages/utils/__init__.py)
回答: 这个错误是由于在'/HOME/scz5178/.conda/envs/yolo-py38/lib/python3.8/site-packages/utils/__init__.py'中无法导入名为'TryExcept'的模块所引起的。根据提供的信息,我无法直接引用到这个具体的错误信息。但是,通常这种错误可能是由于模块的路径问题或者模块本身的问题导致的。你可以尝试检查模块的路径是否正确,并确保模块已经正确安装。如果问题仍然存在,你可以尝试更新或重新安装相关的模块来解决这个问题。
#### 引用[.reference_title]
- *1* *3* [ImportError: /usr/local/anaconda3/envs/py38/lib/python3.8/site-packages/mmcv/_ext.cpython-38-x86_64-](https://blog.csdn.net/weixin_42130300/article/details/121616567)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [ImportError: cannot import name ‘OrderedDict‘ from ‘typing‘ (/root/miniconda3/envs/clip/lib/...)](https://blog.csdn.net/weixin_43656802/article/details/130012263)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文