Code Monkey home page Code Monkey logo

Comments (5)

acbull avatar acbull commented on July 25, 2024

If you cannot install pytorch 1.3, just make sure that the pytorch-geometric is up-to-date with the correct pytorch version. You can refer to their document as a reference (https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html)

from gpt-gnn.

Juicechen95 avatar Juicechen95 commented on July 25, 2024

I install pytorch 1.4.0 and the relevant pytorch-geometric version . But I got the following problem.

Traceback (most recent call last):
File "pretrain_OAG.py", line 249, in
edge_index.to(device), edge_type.to(device))
File "/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/workspace/GPT-GNN/example_OAG/GPT_GNN/model.py", line 191, in forward
meta_xs = gc(meta_xs, node_type, edge_index, edge_type, edge_time)
File "/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/workspace/GPT-GNN/example_OAG/GPT_GNN/conv.py", line 171, in forward
return self.base_conv(meta_xs, node_type, edge_index, edge_type, edge_time)
File "/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/workspace/GPT-GNN/example_OAG/GPT_GNN/conv.py", line 57, in forward
edge_type=edge_type, edge_time = edge_time)
File "/opt/conda/lib/python3.7/site-packages/torch_geometric/nn/conv/message_passing.py", line 233, in propagate
kwargs)
File "/opt/conda/lib/python3.7/site-packages/torch_geometric/nn/conv/message_passing.py", line 156, in collect
self.set_size(size, dim, data)
File "/opt/conda/lib/python3.7/site-packages/torch_geometric/nn/conv/message_passing.py", line 119, in set_size
elif the_size != src.size(self.node_dim):
IndexError: Dimension out of range (expected to be in range of [-1, 0], but got -2)

from gpt-gnn.

Juicechen95 avatar Juicechen95 commented on July 25, 2024

Hi, acbull, I change to python 3.6.12 and cuda 9.2 version (I use python 3.7 and cuda 10.1 before but I found they are conflict with pytorch 1.3.0)。 I finished 'pip install -r requirement.txt' command successfully , but can not import torch_geometric ==。。。

import torch_geometric
Traceback (most recent call last):
File "", line 1, in
File "/opt/conda/lib/python3.6/site-packages/torch_geometric/init.py", line 2, in
import torch_geometric.nn
File "/opt/conda/lib/python3.6/site-packages/torch_geometric/nn/init.py", line 2, in
from .data_parallel import DataParallel
File "/opt/conda/lib/python3.6/site-packages/torch_geometric/nn/data_parallel.py", line 5, in
from torch_geometric.data import Batch
File "/opt/conda/lib/python3.6/site-packages/torch_geometric/data/init.py", line 1, in
from .data import Data
File "/opt/conda/lib/python3.6/site-packages/torch_geometric/data/data.py", line 7, in
from torch_sparse import coalesce
File "/opt/conda/lib/python3.6/site-packages/torch_sparse/init.py", line 2, in
from .coalesce import coalesce
File "/opt/conda/lib/python3.6/site-packages/torch_sparse/coalesce.py", line 2, in
import torch_scatter
File "/opt/conda/lib/python3.6/site-packages/torch_scatter/init.py", line 3, in
from .mul import scatter_mul
File "/opt/conda/lib/python3.6/site-packages/torch_scatter/mul.py", line 3, in
from torch_scatter.utils.ext import get_func
File "/opt/conda/lib/python3.6/site-packages/torch_scatter/utils/ext.py", line 2, in
import torch_scatter.scatter_cpu
ImportError: /opt/conda/lib/python3.6/site-packages/torch_scatter/scatter_cpu.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN3c1011CPUTensorIdEv

I can not figure out what is the problem, could you please give some advises? or provide more details about your environment,such as your python\cuda version. Thanks a lot ~

from gpt-gnn.

acbull avatar acbull commented on July 25, 2024

I think the last problem is caused by the conflict of CUDA version. (probably you didn't delete the previous cuda environment cleanly). My experiment is cuda 9.0 with pytorch 3.6.0.

For the first problem, I think it's caused by the softmax function (https://pytorch-geometric.readthedocs.io/en/1.3.1/_modules/torch_geometric/utils/softmax.html)

Seems like it would be better to explicitly pass the total node number to this function, then my code can be run on the latest pytorch_geometric version.

from gpt-gnn.

Juicechen95 avatar Juicechen95 commented on July 25, 2024

Thank you for your patient answers~ I finally solved my problem. I am in a docker image with python 3.6.7 and cuda 9.2.148. And here is my solution as a reference if anyone need it. I referred to the HGT DockerFile and make some changes to fit my cuda version, so maybe some packages in the following are not needed.

#CUDA 9.2-specific steps.
conda install -y -c pytorch
cudatoolkit=9.2
"pytorch=1.3.0=py3.6_cuda9.2.148_cudnn7.6.3_0"
&& conda clean -ya

#Install HDF5 Python bindings.
conda install -y h5py=2.8.0
&& conda clean -ya
pip install h5py-cache==1.0

#Install TorchNet, a high-level framework for PyTorch.
pip install torchnet==0.0.4

#Install Requests, a Python library for making HTTP requests.
conda install -y requests=2.19.1
&& conda clean -ya

#Install Graphviz.
conda install -y graphviz=2.40.1 python-graphviz=0.8.4
&& conda clean -ya

#Install PyTorch Geometric.
pip install --no-cache-dir torch-scatter==1.3.0 -f https://pytorch-geometric.com/whl/torch-1.3.0.html
pip install --no-cache-dir torch-sparse==0.4.3
&& pip install --no-cache-dir torch-cluster==1.4.5
&& pip install --no-cache-dir torch-spline-conv==1.1.1 -f https://pytorch-geometric.com/whl/torch-1.3.0.html\
&& pip install torch-geometric===1.3.2

pip install dill==0.3.0
&& pip install numpy==1.16.2
&& pip install pandas==0.24.2
&& pip install tqdm==4.31.1
&& pip install seaborn==0.9.0
&& pip install matplotlib==3.0.3
&& pip install transformers==2.8.0

apt-get install zip -y
pip install texttable
conda install gensim tqdm dill pandas matplotlib seaborn -y

#export TERM=xterm # for using 'top'

from gpt-gnn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.