nshepperd/gpt-2

ModuleNotFoundError: No module named 'encoder'

shreesha345 opened this issue ยท 7 comments

$python encode.py training.txt trained.npz
Traceback (most recent call last): File "encode.py", line 9, in <module> import encoder ModuleNotFoundError: No module named 'encoder'
I am using python3.7.8
but I have installed the encoder.
please help me to fix it.

I am having the same issue and am too tired to try and fix it can someone please help me? I'll post a comment if I do eventually get around to fixing it

@shreesha345 @hypotheticalbarfi @Mart17 this does not work, has anyone managed to get this functioning?

For me the solution was the line I posted: PYTHONPATH=src ./encode.py directory-of-data path-to-encoded-output-file.npz

I had to do this in the encode.py
import src.encoder
from src.load_dataset import load_dataset
and then in main()
enc = src.encoder.get_encoder(args.model_name, models_dir=args.models_dir)

this got me over this hump but now I'm stuck in the training part. need to do things similar but still stuck there
I

You should try it on google Colab it will work.
I tryed it on google Colab so you do it also.

move the encoder.py and train.py to the src folder... this works for me dont know why