from torch.utils.ffi import create_extension TypeError: dist must be a Distribution instance

靳睿
2023-12-01

1.问题:torch.utils.ffi is deprecated. Please use cpp extensions instead.
解决:
原来句子:from torch.utils.ffi import create_extension
修改成:
from torch.utils.cpp_extension import BuildExtension
然后:再将文件下面的调用:
ffi = create_extension(…)
改成:
ffi = BuildExtension(…)
2.问题: raise TypeError(“dist must be a Distribution instance”)
解决:将setup.py中的
from distutils.core import setup
修改为
from setuptools import setup
然后:
cd lib
python setup.py build develop

 类似资料:

相关阅读

相关文章

相关问答