Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cs149gpt/module_ref.so: undefined symbol #2

Open
BoL0150 opened this issue Apr 5, 2024 · 6 comments
Open

ImportError: cs149gpt/module_ref.so: undefined symbol #2

BoL0150 opened this issue Apr 5, 2024 · 6 comments

Comments

@BoL0150
Copy link

BoL0150 commented Apr 5, 2024

I am not a student at Stanford. When I ran this assignment on my computer (wsl2, ubuntu22.04), the following error occurred:

(cs149) libo@LAPTOP-VF5QU71L:~/cs149/cs149gpt$ python3 gpt149.py 4Daccess
Traceback (most recent call last):
  File "/home/libo/cs149/cs149gpt/gpt149.py", line 14, in <module>
    import module_ref as ms
ImportError: /home/libo/cs149/cs149gpt/module_ref.so: undefined symbol: _ZN2at4_ops5zeros4callEN3c108ArrayRefINS2_6SymIntEEENS2_8optionalINS2_10ScalarTypeEEENS6_INS2_6LayoutEEENS6_INS2_6DeviceEEENS6_IbEE`

My python version is 3.12.2,pytorch version is 2.2.2,cuda version is 12.3.0

@BoL0150
Copy link
Author

BoL0150 commented Apr 5, 2024

this problem solved by changing pytorch version to 2.1.2

# ubuntu 22.04
# pip install torch==2.1.2

@BoL0150 BoL0150 closed this as completed Apr 5, 2024
@BoL0150 BoL0150 reopened this Apr 5, 2024
@YoungY620
Copy link

YoungY620 commented Oct 19, 2024

My problem is not solved with the solution proposed by @BoL0150 .....

I am using Ubuntu 24.04

I got this error:

ERROR: Could not find a version that satisfies the requirement torch==2.1.2 (from versions: 2.2.0, 2.2.1, 2.2.2, 2.3.0, 2.3.1, 2.4.0, 2.4.1, 2.5.0)
ERROR: No matching distribution found for torch==2.1.2

Maybe friends using ubuntu 24.04 should not waste time like me and just switch to ubuntu 22.04...

@hamsterjiang23
Copy link

PyTorch 2.3.0
Python 3.12(ubuntu22.04)
Cuda 12.1
has same issue

@hamsterjiang23
Copy link

My problem is not solved with the solution proposed by @BoL0150 .....

I am using Ubuntu 24.04

I got this error:

ERROR: Could not find a version that satisfies the requirement torch==2.1.2 (from versions: 2.2.0, 2.2.1, 2.2.2, 2.3.0, 2.3.1, 2.4.0, 2.4.1, 2.5.0)
ERROR: No matching distribution found for torch==2.1.2

Maybe friends using ubuntu 24.04 should not waste time like me and just switch to ubuntu 22.04...

Under ubuntu 22.04 has same issue

@hamsterjiang23
Copy link

My problem is not solved with the solution proposed by @BoL0150 .....

I am using Ubuntu 24.04

I got this error:

ERROR: Could not find a version that satisfies the requirement torch==2.1.2 (from versions: 2.2.0, 2.2.1, 2.2.2, 2.3.0, 2.3.1, 2.4.0, 2.4.1, 2.5.0)
ERROR: No matching distribution found for torch==2.1.2

Maybe friends using ubuntu 24.04 should not waste time like me and just switch to ubuntu 22.04...

PyTorch 2.1.2
Python 3.10(ubuntu22.04)
Cuda 11.8
Work

@IonMich
Copy link

IonMich commented Oct 27, 2024

For those who would prefer to create a conda environment, the following appears to work for all parts of this assignment:

conda create -n gpt149
conda activate gpt149
conda install pytorch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 cpuonly python=3.10 numpy=1.26 ninja tiktoken -c pytorch -c conda-forge

I.e. on top of following the official pytorch instructions for version 2.1.2, I had to specify python=3.10, set numpy to a version less than 2, and install ninja and tiktoken. The CUDA-enabled installation also works if you replace cpuonly with pytorch-cuda=11.8 and add -c nvidia. However this assignment specifies device = 'cpu', so CUDA is not necessary here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants