KennthShang / PhaGCN

GCN classifier for phage taxanomy classification
GNU General Public License v3.0
27 stars 5 forks source link

which run___.py script should I use if I don't have cuda? #8

Closed PB-Shinde closed 2 years ago

PB-Shinde commented 2 years ago

Hello, I dont have CUDA compatible graphic card so I cannot install the CUDA, i even edited your enviroment.py script to remove cudatoolkit from list, So which script should i use to run the PhaGCN without CUDA.

Thank you.

KennthShang commented 2 years ago

Hi,

The code will automatically detect whether you have CUDA. So the only thing you need to make sure is you have installed PyTorch correctly and run the script directly.

Best, Jiayu

PB-Shinde commented 2 years ago

i removed the cudatoolkit from anaconda installation will that be ok. bcuz i ran the demo code using run_speed_up.py and it generated errors.

KennthShang commented 2 years ago

Ummmmm, can you paste your errors here?

PB-Shinde commented 2 years ago

Hello, Actually I closed the console before so i am running the script again with demo file provided by you. the error mentioned below is first one I rececived before The start of DIAMOND

Dictionary cleaned rm: cannot remove 'validation/': No such file or directory rm: cannot remove 'stride50_val/': No such file or directory rm: cannot remove 'int_val/': No such file or directory rm: cannot remove 'filtered_val/': No such file or directory rm: cannot remove 'dataset/': No such file or directory rm: cannot remove 'split_long_reads_val/': No such file or directory Capturing compressed features /home/pratik/anaconda3/envs/Phagcn/lib/python3.6/site-packages/torch/cuda/init.py:52: UserWarning: CUDA initialization: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx (Triggered internally at /opt/conda/conda-bld/pytorch_1607370116979/work/c10/cuda/CUDAFunctions.cpp:100.) return torch._C._cuda_getDeviceCount() > 0 Running with cpu folder out/ exist... cleaning dictionary Dictionary cleaned folder single_contig/ exist... cleaning dictionary Dictionary cleaned folder all_proteins/ exist... cleaning dictionary Dictionary cleaned /home/pratik/anaconda3/envs/Phagcn/lib/python3.6/site-packages/Bio/Seq.py:2338: BiopythonWarning: Partial codon, len(sequence) not a multiple of three. Explicitly trim the sequence or add trailing N before translation. This may become an error in future. BiopythonWarning,

This is the final error,

 119380 edges (min:1.0max: 3e+02, threshold was 1)

Saving network in file out/network.ntw (119380 lines).

------------------------------Calculating E-edges-------------------------------

------------------------------Calculating P-edges-------------------------------

---------------------------Generating Knowledge graph--------------------------- Error: mkl-service + Intel(R) MKL: MKL_THREADING_LAYER=INTEL is incompatible with libgomp.so.1 library. Try to import numpy first or set the threading layer accordingly. Set MKL_SERVICE_FORCE_INTEL to force it. GCN Error for file contig_0 cat: 'pred/': No such file or directory Traceback (most recent call last): File "run_Speed_up.py", line 150, in out = subprocess.check_call(cmd, shell=True) File "/home/pratik/anaconda3/envs/Phagcn/lib/python3.6/subprocess.py", line 291, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command 'cat pred/ > final_prediction.csv' returned non-zero exit status 1.

KennthShang commented 2 years ago

It seems the main error is: "Error: mkl-service + Intel(R) MKL: MKL_THREADING_LAYER=INTEL is incompatible with libgomp.so.1 library." Other messages are all warnings.

In this case you can type in the command export MKL_SERVICE_FORCE_INTEL=1 before runing run_Speed_up.py

KennthShang commented 2 years ago

Also, you can install the cpu-only-version PyTorch via: https://pytorch.org/get-started/locally/

PB-Shinde commented 2 years ago

Thank you. I tired your first suggestion but I am still getting the first error. and i received new error with same statement about MKL. I have provided second error below

---------------------------Generating Knowledge graph--------------------------- Error: mkl-service + Intel(R) MKL: MKL_THREADING_LAYER=INTEL is incompatible with libgomp.so.1 library. Try to import numpy first or set the threading layer accordingly. Set MKL_SERVICE_FORCE_INTEL to force it. Namespace(database='Caudoviridae', dropout=0, epochs=200, hidden=64, learning_rate=0.01, max_degree=3, model='gcn', weight_decay=0.0005) /home/pratik/anaconda3/envs/Phagcn/lib/python3.6/site-packages/torch/cuda/init.py:52: UserWarning: CUDA initialization: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx (Triggered internally at /opt/conda/conda-bld/pytorch_1607370116979/work/c10/cuda/CUDAFunctions.cpp:100.) return torch._C._cuda_getDeviceCount() > 0 Running with cpu adj: (2733, 2733) features: (2733, 512) y: (2733,) (2733,) mask: (2733,) (2733,) x : tensor(indices=tensor([[ 0, 0, 0, ..., 2732, 2732, 2732], [ 463, 450, 447, ..., 52, 34, 32]]), values=tensor([0.0247, 0.0230, 0.0005, ..., 0.1300, 0.1080, 0.0444]), size=(2733, 512), nnz=65738, layout=torch.sparse_coo) sp: tensor(indices=tensor([[ 0, 1, 2, ..., 481, 482, 2732], [ 0, 0, 0, ..., 2732, 2732, 2732]]), values=tensor([0.0196, 0.0206, 0.0192, ..., 0.0668, 0.0668, 0.2500]), size=(2733, 2733), nnz=122119, layout=torch.sparse_coo) input dim: 512 output dim: 8 num_features_nonzero: 65738 /home/pratik/PhaGCN-main/utils.py:52: UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead. (Triggered internally at /opt/conda/conda-bld/pytorch_1607370116979/work/aten/src/ATen/native/IndexingUtils.h:25.) i = i[:, dropout_mask] /home/pratik/PhaGCN-main/utils.py:53: UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead. (Triggered internally at /opt/conda/conda-bld/pytorch_1607370116979/work/aten/src/ATen/native/IndexingUtils.h:25.) v = v[dropout_mask] 0 20.063405990600586 0.13377926421404682 10 16.180316925048828 0.6566332218506131 20 13.35247802734375 0.8498699368264586 30 11.121603965759277 0.8985507246376812 40 9.358479499816895 0.9178743961352657 50 8.06788158416748 0.9386845039018952 60 6.872446537017822 0.9539204756596061 70 5.976304531097412 0.9580081753994798 80 5.187221527099609 0.959866220735786 90 4.392453670501709 0.9672984020810108 100 3.8958206176757812 0.9777034559643255 110 3.3701281547546387 0.9710144927536232 120 2.949018955230713 0.9698996655518395 130 2.5859951972961426 0.9773318468970643 140 2.2789244651794434 0.9698996655518395 150 1.9944944381713867 0.9747305834262356 160 1.7902315855026245 0.9747305834262356 170 1.5868384838104248 0.9721293199554069 180 1.4339710474014282 0.9725009290226682 190 1.278964638710022 0.9773318468970643 200 1.136709451675415 0.9762170196952805 210 1.0232924222946167 0.9751021924934968 220 0.9607961177825928 0.9721293199554069 230 0.8642004132270813 0.9725009290226682 240 0.7400785684585571 0.9765886287625418 250 0.7001307010650635 0.9765886287625418 260 0.6570683121681213 0.9758454106280193 270 0.6509138941764832 0.9702712746191007 280 0.5778768062591553 0.9710144927536232 290 0.5755269527435303 0.9728725380899294 300 0.48276859521865845 0.9777034559643255 310 0.492046058177948 0.9754738015607581 320 0.45734477043151855 0.9747305834262356 330 0.41533011198043823 0.9721293199554069 340 0.39706850051879883 0.9777034559643255 350 0.4337209463119507 0.9773318468970643 360 0.37262189388275146 0.9717577108881457 370 0.39227569103240967 0.9762170196952805 380 0.3281945586204529 0.9754738015607581 390 0.33061936497688293 0.9762170196952805

KennthShang commented 2 years ago

Hi,

The program seems to work correctly since it outputs the loss and accuracy of training data. Please check whether it generates the prediction.

Again, the first message is just a warning to tell you that you do not have a GPU unit.

Best, Jiayu

PB-Shinde commented 2 years ago

Thank you I think the problem is solved, just one final question, does PhyGCN only predicts phage at family level?

KennthShang commented 2 years ago

Theoretical PhaGCN can predict any taxa level, however, there is not much data for training at genus and species levels. We will solve this problem with another tool, which is still in testing.

PB-Shinde commented 2 years ago

Thank you for your reply.

--

Regards

Mr. Pratik Balwant Shinde Project Assistant, ICMR Project, C/O Dr. K.K. Sharma, Department of Microbiology, Maharshi Dayanand University Rohtak +91-9594035391

On Tue, Feb 8, 2022, 5:48 PM Kenneth Shang @.***> wrote:

Theoretical PhaGCN can predict any taxa level, however, there is not much data for training at genus and species levels. We will solve this problem with another tool, which is still in testing.

— Reply to this email directly, view it on GitHub https://github.com/KennthShang/PhaGCN/issues/8#issuecomment-1032546759, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATQGBY47O5KWMS4G6QPFMBLU2ECZBANCNFSM5NZPRDFA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>