当前位置:   article > 正文

Python常见报错总结_typeerror: np.matrix is not supported. please conv

typeerror: np.matrix is not supported. please convert to a numpy array with

持续更新中......

TypeError: np.matrix is not supported. Please convert to a numpy array with np.asarray

解决方案:https://github.com/XingyanLiu/CAME/issues/20

  1. numpy 1.23.2
  2. scikit-learn 1.1.2
  3. scipy 1.9.1

使用CUDA进行模型训练时出现错误RuntimeError: No CUDA GPUs are available

解决方案:1.先检测是否有GPU

print(torch.cuda.is_available())

返回0则是pytorch CUDA安装的问题

2.如果返回1,注意代码中是否有“os.environ”,“CUDA_VISIBLE_DEVICE”,是否是代码设置了显卡编号,默认编号是0

AttributeError: module 'numpy' has no attribute 'float'

解决方案:从numpy1.24起,删除了numpy.bool、numpy.int、numpy.fioat、numpy.complex, numpy.object, numpy.str、numpy.long、numpy.unicode类型的支持

  1. pip uninstall numpy
  2. pip install numpy==1.23.5

找不到指定的模块fbgemm.dll

pytorch|找不到 fbgemm.dll 问题处理-CSDN博客

OSError: [WinError 126] 找不到指定的模块。 Error loading “E:\python310\lib\site-packages\torch\lib\fbgemm.dll-CSDN博客

解决 python出现的[WinError 126] 找不到指定的模块。fbgemm.dll“ or one of its dependencies.-CSDN博客 torch fbgemm.dll 报错-CSDN博客

Failed to import pytorch fbgemm.dll or one of its dependencies is missing - #27 by traits - windows - PyTorch Forums

 从零开始搭建LLaMA-Factory_libomp140-CSDN博客

  1. This is still unresolved. I have pip installations with
  2. torch-2.4.0+cu121
  3. VC_redist.x64.exe (14.40.33810.0)
  4. NVIDIA drivers 560.70
  5. on two machines
  6. Win10:
  7. with additional full Visual Studio 2022 installation
  8. dedicated RTX 3070
  9. Win11
  10. no Visual Studio
  11. eGPU GTX 1060
  12. The Win10 version is working, the Win11 version not.
  13. edit: Win10 has libomp140.x86_64.dll in c:/Windows/System32 (and a debug version elsewhere for VS 2022), the Win11 version has nothing on the whole drive. So, this dll seems to be no longer a part of vcredist. I loosely remember some recent problems in downloading OpenMP from Microsoft, but cannot find the associated defunctional link.

 这个环境看出win11的libomp140跟win10不太一样,我的环境也是win11,不知道是不是这个原因

 libomp140.x86_64.dll文件不知道是不是网络的问题太难下载,放在顶部资源

把libomp140.x86_64.dll放在C:\Windows\SysWOW64下,import torch不在报错!!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/喵喵爱编程/article/detail/909527
推荐阅读
  

闽ICP备14008679号