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: No module named torch #6

Closed
SeekPoint opened this issue Jun 10, 2019 · 1 comment
Closed

ImportError: No module named torch #6

SeekPoint opened this issue Jun 10, 2019 · 1 comment

Comments

@SeekPoint
Copy link

Installing collected packages: numpy, torch, tqdm
Found existing installation: numpy 1.16.4
Uninstalling numpy-1.16.4:
Successfully uninstalled numpy-1.16.4
Found existing installation: torch 0.4.1
Uninstalling torch-0.4.1:
Successfully uninstalled torch-0.4.1
Found existing installation: tqdm 4.31.1
Uninstalling tqdm-4.31.1:
Successfully uninstalled tqdm-4.31.1
Successfully installed numpy-1.14.5 torch-1.1.0 tqdm-4.32.1

ub16c9@ub16c9-gpu:/media/ub16c9/fcd84300-9270-4bbd-896a-5e04e79203b7/ub16_prj/TextGAN-PyTorch/run$ python3.6 run_seqgan.py 0 0
job_id: 0, gpu_id: 0
Traceback (most recent call last):
File "main.py", line 5, in
import config as cfg
File "/media/ub16c9/fcd84300-9270-4bbd-896a-5e04e79203b7/ub16_prj/TextGAN-PyTorch/config.py", line 13, in
import torch
ImportError: No module named torch

ub16c9@ub16c9-gpu:/media/ub16c9/fcd84300-9270-4bbd-896a-5e04e79203b7/ub16_prj/TextGAN-PyTorch/run$ python3.6
Python 3.6.8 (default, Dec 24 2018, 19:24:27)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.

import torch
torch.version
'1.1.0'
quit()
ub16c9@ub16c9-gpu:/media/ub16c9/fcd84300-9270-4bbd-896a-5e04e79203b7/ub16_prj/TextGAN-PyTorch/run$

@SeekPoint
Copy link
Author

we must change it :

ub16c9@ub16c9-gpu:/media/ub16c9/fcd84300-9270-4bbd-896a-5e04e79203b7/ub16_prj/TextGAN-PyTorch$ git diff
diff --git a/run/run_seqgan.py b/run/run_seqgan.py
index 95dba82..3fb57fe 100644
--- a/run/run_seqgan.py
+++ b/run/run_seqgan.py
@@ -27,7 +27,7 @@ else:
print('Missing argument: job_id and gpu_id. Use default job_id: {}, gpu_id: {}'.format(job_id, gpu_id))

Executables

-executable = 'python'
+executable = 'python3.6'

=====Program=====

if_test = int(False)
ub16c9@ub16c9-gpu:/media/ub16c9/fcd84300-9270-4bbd-896a-5e04e79203b7/ub16_prj/TextGAN-PyTorch$

a SHAO operation

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

1 participant