lamoureux-lab / TorchProteinLibrary

PyTorch library of layers acting on protein representations
https://lamoureux-lab.github.io/TorchProteinLibrary/
MIT License
116 stars 23 forks source link

Compile time errors when install the tool #24

Closed caorenzhi closed 5 years ago

caorenzhi commented 5 years ago

I am trying the install the tool in my centos 7 machine, and I have install gcc 7.3.0, and also pytorch together with other required tools, but when I run python setup.py install, I still get error message: No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda' running install running bdist_egg running egg_info writing TorchProteinLibrary.egg-info/PKG-INFO writing dependency_links to TorchProteinLibrary.egg-info/dependency_links.txt writing top-level names to TorchProteinLibrary.egg-info/top_level.txt reading manifest file 'TorchProteinLibrary.egg-info/SOURCES.txt' writing manifest file 'TorchProteinLibrary.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg gcc -pthread -B /home/caora/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wst rict-prototypes -fPIC -ILayers/RMSD -IMath -I/home/caora/anaconda3/lib/python3.7/site-packages/torch/include -I/home/ca ora/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/caora/anaconda3/lib/python3.7/si te-packages/torch/include/TH -I/home/caora/anaconda3/lib/python3.7/site-packages/torch/include/THC -I/home/caora/anacon da3/include/python3.7m -c Math/cMatrix33.cpp -o build/temp.linux-x86_64-3.7/Math/cMatrix33.o -DTORCH_API_INCLUDE_EXTENS ION_H -DTORCH_EXTENSION_NAME=_RMSD_CPU -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11 gcc -pthread -B /home/caora/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wst rict-prototypes -fPIC -ILayers/RMSD -IMath -I/home/caora/anaconda3/lib/python3.7/site-packages/torch/include -I/home/ca ora/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/caora/anaconda3/lib/python3.7/si te-packages/torch/include/TH -I/home/caora/anaconda3/lib/python3.7/site-packages/torch/include/THC -I/home/caora/anacon da3/include/python3.7m -c Math/cMatrix44.cpp -o build/temp.linux-x86_64-3.7/Math/cMatrix44.o -DTORCH_API_INCLUDE_EXTENS ION_H -DTORCH_EXTENSION_NAME=_RMSD_CPU -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11 gcc -pthread -B /home/caora/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wst rict-prototypes -fPIC -ILayers/RMSD -IMath -I/home/caora/anaconda3/lib/python3.7/site-packages/torch/include -I/home/ca ora/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/caora/anaconda3/lib/python3.7/si te-packages/torch/include/TH -I/home/caora/anaconda3/lib/python3.7/site-packages/torch/include/THC -I/home/caora/anacon da3/include/python3.7m -c Math/cVector3.cpp -o build/temp.linux-x86_64-3.7/Math/cVector3.o -DTORCH_API_INCLUDE_EXTENSIO N_H -DTORCH_EXTENSION_NAME=_RMSD_CPU -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11 gcc -pthread -B /home/caora/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wst rict-prototypes -fPIC -ILayers/RMSD -IMath -I/home/caora/anaconda3/lib/python3.7/site-packages/torch/include -I/home/ca ora/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/caora/anaconda3/lib/python3.7/si te-packages/torch/include/TH -I/home/caora/anaconda3/lib/python3.7/site-packages/torch/include/THC -I/home/caora/anacon da3/include/python3.7m -c Layers/RMSD/Coords2RMSD_CPU/coords2rmsd_interface.cpp -o build/temp.linux-x86_64-3.7/Layers/R MSD/Coords2RMSD_CPU/coords2rmsd_interface.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_RMSD_CPU -D_GLIBCXX _USE_CXX11_ABI=0 -std=c++11 /home/caora/anaconda3/lib/python3.7/site-packages/torch/include/c10/core/Allocator.h:123:13: note: candidate: bool c10::operator!=(std::nullptr_t, const c10::DataPtr&) inline bool operator!=(std::nullptr_t, const DataPtr& dp) noexcept { ^~~~ /home/caora/anaconda3/lib/python3.7/site-packages/torch/include/c10/core/Allocator.h:123:13: note: no known conversion for argument 1 from ‘caffe2::TypeMeta’ to ‘std::nullptr_t’ /home/caora/anaconda3/lib/python3.7/site-packages/torch/include/c10/core/Allocator.h:120:13: note: candidate: bool c10::operator!=(const c10::DataPtr&, std::nullptr_t) inline bool operator!=(const DataPtr& dp, std::nullptr_t) noexcept { ^~~~ /home/caora/anaconda3/lib/python3.7/site-packages/torch/include/c10/core/Allocator.h:120:13: note: no known conversion for argument 1 from ‘caffe2::TypeMeta’ to ‘const c10::DataPtr&’ error: command 'gcc' failed with exit status 1

Any thoughts? Thanks!

caorenzhi commented 5 years ago

Layers/RMSD/Coords2RMSD_CPU/coords2rmsd_interface.cpp: In function ‘void Coords2RMSD_CPU_forward(at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor)’: Layers/RMSD/Coords2RMSD_CPU/coords2rmsd_interface.cpp:12:21: error: no match for ‘operator!=’ (operand types are ‘caffe2::TypeMeta’ and ‘const c10::ScalarType’) if( src.dtype() != at::kDouble || dst.dtype() != at::kDouble || rmsd.dtype() != at::kDouble


In file included from /home/caora/anaconda3/lib/python3.7/site-packages/torch/include/c10/core/ScalarType.h:6:0,
                 from /home/caora/anaconda3/lib/python3.7/site-packages/torch/include/c10/core/Scalar.h:9,
                 from /home/caora/anaconda3/lib/python3.7/site-packages/torch/include/ATen/core/Type.h:8,
                 from /home/caora/anaconda3/lib/python3.7/site-packages/torch/include/ATen/Type.h:2,
                 from /home/caora/anaconda3/lib/python3.7/site-packages/torch/include/ATen/Context.h:4,
                 from /home/caora/anaconda3/lib/python3.7/site-packages/torch/include/ATen/ATen.h:5,
 .....

Is that because of the version problem? 
lupoglaz commented 5 years ago

Hello, you probably installed pytorch1.0. Please use the branch dev for pytorch1.0 version. The Release branch is written before version 1.0 was out.

caorenzhi commented 5 years ago

Hi, I checked the version of my Pytorch, it is 1.1.0, is that the issue? I have tried to fix it by modifying the code, for example, at::CPU(at::kDouble).zeros({4,2}) is not working in my machine, but I modified to at::zeros({4,2}, at::kDouble), it worked. However, there are still some other errors like: Layers/Volume/Select/select_interface.cpp:37:55: error: no matching function for call to ‘c10::Scalar::Scalar(at::Tensor)’ int single_num_atoms = at::Scalar(num_atoms[i]).toInt();

Renzhi Cao, Ph.D. Assistant Professor Department of Computer Science Pacific Lutheran University Email: caora@plu.edu Phone: (253)-535-7409 Office: MCLT 248 https://cs.plu.edu/~caora/ https://cs.plu.edu/~caora/

Request for letter of recommendation https://docs.google.com/forms/d/e/1FAIpQLSf62gmyIvNqI2yoaVx1_GDY_vq_8t9Yjx5kMbqplvfQ8WVEQg/viewform?vc=0&c=0&w=1&usp=mail_form_link

On Wed, Jul 3, 2019 at 5:33 AM George notifications@github.com wrote:

Hello, you probably installed pytorch1.0. Please use the branch dev for pytorch1.0 version. The Release branch is written before version 1.0 was out.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lupoglaz/TorchProteinLibrary/issues/24?email_source=notifications&email_token=AFKYQRVAWAVCEP2NULI36SDP5SMBLA5CNFSM4H4U5YA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZEJMPI#issuecomment-508073533, or mute the thread https://github.com/notifications/unsubscribe-auth/AFKYQRT3354YI2MDBRKITFTP5SMBLANCNFSM4H4U5YAQ .

lupoglaz commented 5 years ago

I checked the version of my Pytorch, it is 1.1.0, is that the issue?

No, I use this version on dev branch The only issue is that there are yet undocumented changes in some layers and functions

I have tried to fix it by modifying the code

Well, that's also a solution, but there's similar check in every function

caorenzhi commented 5 years ago

I used gcc 7.3.0, is that too high? I am right now trying to install gcc 5.4.0, hopefully it could help to solve the problem. Could you please let me know the operating system and gcc version you are testing on now? Thanks

Renzhi Cao, Ph.D. Assistant Professor Department of Computer Science Pacific Lutheran University Email: caora@plu.edu Phone: (253)-535-7409 Office: MCLT 248 https://cs.plu.edu/~caora/ https://cs.plu.edu/~caora/

Request for letter of recommendation https://docs.google.com/forms/d/e/1FAIpQLSf62gmyIvNqI2yoaVx1_GDY_vq_8t9Yjx5kMbqplvfQ8WVEQg/viewform?vc=0&c=0&w=1&usp=mail_form_link

On Wed, Jul 3, 2019 at 8:35 AM George notifications@github.com wrote:

I checked the version of my Pytorch, it is 1.1.0, is that the issue? No, I use this version on dev branch The only issue is that there are yet undocumented changes in some layers and functions

I have tried to fix it by modifying the code Well, that's also a solution, but there's similar check in every function

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lupoglaz/TorchProteinLibrary/issues/24?email_source=notifications&email_token=AFKYQRTOHVMCJFK4CRXOP6TP5TBLFA5CNFSM4H4U5YA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZE222Q#issuecomment-508145002, or mute the thread https://github.com/notifications/unsubscribe-auth/AFKYQRRWZBGBDLQ3NHCY3LDP5TBLFANCNFSM4H4U5YAQ .

caorenzhi commented 5 years ago

Some updates:

  1. Most of the problems solved by using gcc 5.4.0.
  2. Now I have Layers/Volume/Select/select_interface.cpp,

error: no matching function for call to ‘c10::Scalar::Scalar(at::Tensor)

     int single_num_atoms = at::Scalar(num_atoms[i]).toInt();

Is that because of my pytorch version issue?

Renzhi Cao, Ph.D. Assistant Professor Department of Computer Science Pacific Lutheran University Email: caora@plu.edu Phone: (253)-535-7409 Office: MCLT 248 https://cs.plu.edu/~caora/ https://cs.plu.edu/~caora/

Request for letter of recommendation https://docs.google.com/forms/d/e/1FAIpQLSf62gmyIvNqI2yoaVx1_GDY_vq_8t9Yjx5kMbqplvfQ8WVEQg/viewform?vc=0&c=0&w=1&usp=mail_form_link

On Wed, Jul 3, 2019 at 8:54 AM Renzhi Cao caora@plu.edu wrote:

I used gcc 7.3.0, is that too high? I am right now trying to install gcc 5.4.0, hopefully it could help to solve the problem. Could you please let me know the operating system and gcc version you are testing on now? Thanks

Renzhi Cao, Ph.D. Assistant Professor Department of Computer Science Pacific Lutheran University Email: caora@plu.edu Phone: (253)-535-7409 Office: MCLT 248 https://cs.plu.edu/~caora/ https://cs.plu.edu/~caora/

Request for letter of recommendation https://docs.google.com/forms/d/e/1FAIpQLSf62gmyIvNqI2yoaVx1_GDY_vq_8t9Yjx5kMbqplvfQ8WVEQg/viewform?vc=0&c=0&w=1&usp=mail_form_link

On Wed, Jul 3, 2019 at 8:35 AM George notifications@github.com wrote:

I checked the version of my Pytorch, it is 1.1.0, is that the issue? No, I use this version on dev branch The only issue is that there are yet undocumented changes in some layers and functions

I have tried to fix it by modifying the code Well, that's also a solution, but there's similar check in every function

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lupoglaz/TorchProteinLibrary/issues/24?email_source=notifications&email_token=AFKYQRTOHVMCJFK4CRXOP6TP5TBLFA5CNFSM4H4U5YA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZE222Q#issuecomment-508145002, or mute the thread https://github.com/notifications/unsubscribe-auth/AFKYQRRWZBGBDLQ3NHCY3LDP5TBLFANCNFSM4H4U5YAQ .

caorenzhi commented 5 years ago

I have fixed that by the following: int single_num_atoms = num_atoms[i].item().toInt(); Could you please double check that?

lupoglaz commented 5 years ago

I double checked it, but it looks like you are using the "master" branch: https://github.com/lupoglaz/TorchProteinLibrary/blob/master/Layers/Volume/Select/select_interface.cpp

in fact, if you use "dev" branch this line was already corrected to be compiled with pytorch 1.0: https://github.com/lupoglaz/TorchProteinLibrary/blob/dev/Layers/Volume/Select/select_interface.cpp (line 37)

lupoglaz commented 5 years ago

Notification added in the commit cc89b5337d479a71e57227e614a934297a6d200a