williamSYSU / TextGAN-PyTorch

TextGAN is a PyTorch framework for Generative Adversarial Networks (GANs) based text generation models.
MIT License
892 stars 205 forks source link

ImportError: No module named torch #6

Closed SeekPoint closed 5 years ago

SeekPoint commented 5 years ago

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 commented 5 years ago

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