Swin-Transformer icon indicating copy to clipboard operation
Swin-Transformer copied to clipboard

can't install by using:pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext

Open Derek-Kun opened this issue 3 years ago • 5 comments

My system envs is CentOS7/cuda 10.1.243 /cudnn 7.6.5,which is exactly the same envs as the tutorial envs. However, when I run the command line on the title, I got "RuntimeError: Error compiling objects for extension" error message. My pytorch version is 1.7.1, I thought it's a incompatible problem between the pytorch version and cuda version, so I changed the pytorch into 1.7.0/1.6.0, but still got the same error message. is there any one can help me ?

Derek-Kun avatar Aug 05 '21 07:08 Derek-Kun

cd apex python setup.py install try it

xdFai avatar Oct 14 '21 15:10 xdFai

cd apex python setup.py install try it

Thanks,it is efficient

tb2-sy avatar Oct 23 '21 14:10 tb2-sy

If use “python setup.py install”,it will show error when I eval?But it is Ok,when I train model. Traceback (most recent call last): File "main.py", line 347, in main(config) File "main.py", line 96, in main lr_scheduler = build_scheduler(config, optimizer, len(data_loader_train)) File "/disk/XXX/XXXX/Swin-Transformer/lr_scheduler.py", line 29, in build_scheduler t_in_epochs=False, File "/home/XXX/XXX/anaconda3/envs/swin/lib/python3.7/site-packages/timm/scheduler/cosine_lr.py", line 48, in init assert t_initial > 0 AssertionError How to solve this problem?thanks

tb2-sy avatar Oct 24 '21 06:10 tb2-sy

Hi @tb2-sy, it seems that the len(data_loader_train) is 0. You can first check if the training data path is correct. If you just want to eval, you can hack it by setting an arbitrary number like:

lr_scheduler = build_scheduler(config, optimizer, 1000)

zeliu98 avatar Dec 14 '21 06:12 zeliu98

Oh thanks, I will give it a try.

tb2-sy avatar Dec 14 '21 07:12 tb2-sy