TIP icon indicating copy to clipboard operation
TIP copied to clipboard

assertion error

Open simosss opened this issue 4 years ago • 7 comments

Hello! I am trying to reproduce the results of the TIP paper in the framework of my graduate thesis. I run prepare.py to completion as described in readme. But when I run the tip.py script I get an assertion error telling me that the edge_index is not of the torch.long type (I attach the full error). Any ideas on why this might be the case?

tip_error.txt

simosss avatar Dec 11 '21 21:12 simosss

Maybe you can cast the type of edge_index by edge_index.long() if edge_index is a torch tensor.

ZillaRU avatar Jan 05 '22 06:01 ZillaRU

I am afraid it is not that simple in this case. The model uses a Pytorch geometric Data structure (red by a pickle export) that contains multiple tensors. Not sure which of them causes the problem. I tried to find my way through debbuging but I had to dive deep into the code and still haven't figured out a solution. Obviously, other people seem to have rerun and reproduce the results in the past without problem, so I cannot understand why this error appears in the first place.

Thanks for trying to help!

simosss avatar Feb 08 '22 20:02 simosss

@ZillaRU, thank you for the suggestion!

Hi @simosss, as shown in the tip_error.txt file you provided, the error probably is caused by the conflict between the CUDA version installed on the computer (cu100) and the version supported by PyTorch (cu102).

C:\Users\simos\Anaconda3\envs\TIP\lib\site-packages\torch\cuda_init_.py:80: UserWarning: CUDA initialization: The NVIDIA driver on your system is too old (found version 7050). Please update your GPU driver by downloading and installing a new version from the URL: http://www.nvidia.com/Download/index.aspx Alternatively, go to: https://pytorch.org to install a PyTorch version that has been compiled with your version of the CUDA driver. (Triggered internally at ..\c10\cuda\CUDAFunctions.cpp:112.)

Could you please try to update your CUDA to version 10.2?

NYXFLOWER avatar Feb 08 '22 22:02 NYXFLOWER

Hi @NYXFLOWER thanks for the suggestion!

Unfortunately, this doesn't seem to solve the problem. I updated cuda toolkit to version 10.2 and I get the same error only without the warning in the beginning. In the past I have also tried to run it on cpu with the same result.

I don't know if the version of the pytorch and pytorch geometric are to be blamed, since I am not able to reproduce the environment you mention on the README (I get conflicts when I try) and so I use the current stable versions (pytorch 1.10.2, pyg 2.0.3)

Any more thoughts would be more than welcome, thanks a lot!

simosss avatar Feb 09 '22 10:02 simosss

Thank you for the feedback, @simosss!

There is another stable environment with cuda 10.1, python 3.7.6, pytorch 1.4.0, torch-geometric 1.4.2, torch-scatter 2.0.4, torch-sparse 0.6.1, and torch-spline-conv 1.2.0 (see more details in tip_gpu_2.yml.zip).

For your convenience, here is the link for installing a PyG < 2.0 and its prerequisite packages: https://data.pyg.org/whl/.

I had tested this environment several days ago, and it ran successfully on multiple servers. Hope it works this time!

NYXFLOWER avatar Feb 10 '22 05:02 NYXFLOWER

Hello again @NYXFLOWER !

Thanks for the detailed description. I would probably be unable to install the particular environment without this extra help. Unfortunately I still get a similar (?) error, although a different one. (see attachment)

I am not sure what to make of it. I believe I recreated the environment you described accurately. Maybe the environment was not the issue in the first place?
Could operation system have anything to do with it? I don't know.

tip_error_python3.7.6.txt

simosss avatar Feb 27 '22 09:02 simosss

Hi @simosss, I am sorry for the late reply. I hope you have solved this issue.

I recently met the same error as you mentioned in tip_error_python3.7.6.txt. I found it is caused by the wrong data type of two variables: data.gd_edge_index and data.gg_edge_index. I solved this issue by changing their type to torch.long:

data.gd_edge_index = data.gd_edge_index.type(torch.long)
data.gg_edge_index = data.gg_edge_index.type(torch.long)

@ZillaRU's suggestion in https://github.com/NYXFLOWER/TIP/issues/15#issuecomment-1005428290 also works. Thanks!

NYXFLOWER avatar Aug 26 '22 02:08 NYXFLOWER