princeton-vl / pose-ae-train

Training code for "Associative Embedding: End-to-End Learning for Joint Detection and Grouping"
BSD 3-Clause "New" or "Revised" License
373 stars 76 forks source link

TypeError: dist must be a Distribution instance #45

Open dzyjjpy opened 4 years ago

dzyjjpy commented 4 years ago

pytorch:1.2.0, torchvision:0.4.0 When I excute the comand: python build.py install as errors occured(create_extension is deprecated), so I edit the code as below:

from torch.utils.ffi import create_extension?

from torch.utils.cpp_extension import BuildExtension

extra_objects = ['src/my_lib_kernel.o'] # there is no my_lib_kernel.o file in project subdirectory /src/ extra_objects = [os.path.join(this_file, fname) for fname in extra_objects]

ffi = create_extension(

ffi = BuildExtension( '_ext.my_lib', headers=headers, sources=sources, define_macros=defines, relative_to=file, with_cuda=with_cuda, extra_objects=extra_objects # error happened this line )

TypeError happened as below: Including CUDA code. Traceback (most recent call last): File "build.py", line 31, in extra_objects=extra_objects File "/home/jiapy/virtualEnv/py3torch1.2/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 233, in init super(BuildExtension, self).init(*args, kwargs) File "/home/jiapy/virtualEnv/py3torch1.2/lib/python3.6/site-packages/setuptools/init.py", line 163, in init _Command.init(self, dist) File "/usr/lib/python3.6/distutils/cmd.py", line 57, in init raise TypeError("dist must be a Distribution instance") TypeError: dist must be a Distribution instance**

Anyone have similar experience? Any advice for solving the issue will be appreciated. Thanks

dzyjjpy commented 4 years ago

try to downgrade setuptools's version to 20.0, it doesn't work...

dzyjjpy commented 4 years ago

Hi @anewell do you have any advice for the issue?

wanfb commented 4 years ago

my_lib_kernel.o is the output of the comment "os.system("cd src;nvcc my_lib_kernel.cu -c -o my_lib_kernel.o -x cu -Xcompiler -fPIC -arch=sm_52")" in build.py. You can actually try to run this comment first.

wanfb commented 4 years ago

I finally solved this problem by downgrading pytorch version to 0.4.0 and using ubuntu version 16.04.

leoluopy commented 3 years ago

I finally solved this problem by downgrading pytorch version to 0.4.0 and using ubuntu version 16.04.

thanks for sharing the method , i created a new torch env using pyenv ,and the problem is solved

Boatsure commented 3 years ago

same problem, downgrade setuptools to 0.9.8 solve this error, but it comes out other errors which need upgrade setuptools...