for-ai / CipherGAN

TensorFlow implementation of CipherGAN
https://openreview.net/forum?id=BkeqO7x0-
MIT License
121 stars 24 forks source link

ModuleNotFoundError: No module named '__main__.hparams'; '__main__' is not a package #6

Closed Ye-XX closed 5 years ago

Ye-XX commented 5 years ago

Hello,I have a question to ask you. I hope you can help me solve it. I did the calculation according to your method, and the following problem occurred in the second step. I've tried my best to solve it, but I still can't.Questions as follows:

E:\WorkSpace\venv\Scripts\python.exe E:/WorkSpace/CipherGAN/train.py Traceback (most recent call last): File "E:/WorkSpace/CipherGAN/train.py", line 5, in from .hparams.registry import get_hparams ModuleNotFoundError: No module named 'main.hparams'; 'main' is not a package

bryanlimy commented 5 years ago

Hi, what was the command you used to run train.py?

Ye-XX commented 5 years ago

Follow your instructions. train.py \ --output_dir=runs/vig345 \ --test_name="vigenere345-brown200-eval" \ --train_name="vigenere345-brown200-train" \ --hparam_sets=vigenere_brown_vocab_200

bryanlimy commented 5 years ago

please try using -m, and run the command outside of the CipherGAN folder.

python -m CipherGAN.train \
  --output_dir=runs/vig345 \
  --test_name="vigenere345-brown200-eval*" \
  --train_name="vigenere345-brown200-train*" \
  --hparam_sets=vigenere_brown_vocab_200
bryanlimy commented 5 years ago

Hi @w632752464 are you able to test with the above command?

Ye-XX commented 5 years ago

Sorry,I have been busy recently, and I tried it this morning and it is ok. The reason: Instead of downloading zip, should downloaded the source code using git. After downloading it, according to your step and it is ok.

Ye-XX commented 5 years ago

Thank you for your sincere reply!

bryanlimy commented 5 years ago

I am closing this issue now, please create a new one if you experience any other problem :)