Try to install pytorch v0.4 from source code, but empty in subdirs of thrid_party


My computer is offline and cannot access internet. Thus I try to install from the released zip file, but when I uncompress the zip file, it is empty in the subdirs of dir thrid_party. How can I install pytorch from source code on a computer without internet? thanks


You would need to get all the submodules from the git repo.
I am not sure what is the best way to do that.

Thanks @albanD. now i get all submodules, but when I install it using “python install”, it gives me following errors:
$ python install
tools/ line 2: $’\r’: command not found
tools/ line 10: $’\r’: command not found
: invalid line 11: set: -
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [–] [arg …]
tools/ line 12: $’\r’: command not found
tools/ line 112: syntax error near unexpected token elif' 'ools/ line 112:elif [[ “$REL_WITH_DEB_INFO” ]]; then

Any ideas?

It looks like the bash script is not read properly.
What is the machine are you using? Did you use a windows machine at some point to tranfer the files, it looks like end of line symbols are wrong.

1 Like

Yes, I first git clone the code in my windows PC, then copy the source code to my ubuntu server. Now i fixed it. thanks

Hi @albanD, another strange thing is that pytroch cannot find GPU on my server, before upgrade it is OK. when i call pytorch, it says that “pytorch was compiled without cuDNN support”, do you know how to fix it? thanks

Do you have cudnn installed on the machine while installing?
During the installation there are prints of the cuda version that is detected and the cudnn version that is detected as well.
If your cudnn is at the same place as cuda then it should work fine.
If you won’t want to use cudnn and don’t have it installed, I guess you can set torch.backends.cudnn.enabled=False.

When I compile pytorch, it says “cuDNN cannot be found”. it is so strange.
I want to use cudnn, before cudnn works for pytorch version 0.1, but now since i upgraded it to pytorch 0.4, now GPUs cannot be found by pytorch.

Is cuda found? Or just cudnn is missing?

cuda is detected: v8.00, only cudnn is missing.

Where is cudnn installed on your machine? And which version?

it is cudnn v5, which is not supported by pytorch, right? I need update it

Yes this version is potentially too old.
You may want to try to upgrade to the latest version for cuda 8.0.
Also to make sure it’s detected, you can install it in you ./lib64 and ./include folders inside the cuda install.

Thanks. Now i installed the cuda 7.0 and pytorch is successfully compiled with GPU, now i can call torch.cuda.isavalable() return True.

But another error happens, it says “runtime error: cublas runtime error, library not initialized at…/THCGeneral.cpp:377”.


What is the code that you run to get this error?
Are the cuda samples working properly on your machine?

I ran simpleCUBLAS of cuda sampels and it is OK.

when i ran torch.cuda.is_available(), it returns True.

i just ran lstm = nn.LSTM(3,3)
then I got the error

And if you run torch.cuda.FloatTensor(10) ?

No error, torch.cuda.FloatTensor(10) is OK.

And after running that, can you use your LSTM module properly?

No, still cannot run LSTM correctly and gives the same error.