DialoGPT icon indicating copy to clipboard operation
DialoGPT copied to clipboard

LSP_train.py failing - output_dir NoneType

Open made-by-chris opened this issue 4 years ago • 4 comments

line 154 fails

output_dir = join(args.output_dir,
                  'GPT2.{}.{}.{}gpu.{}'.format(args.learning_rate,
                                               args.train_batch_size, n_gpu, timestamp))

with: ´´´ Traceback (most recent call last): File "./LSP_train.py", line 154, in args.train_batch_size, n_gpu, timestamp)) File "/opt/conda/envs/pytorch-py3.6/lib/python3.6/posixpath.py", line 80, in join a = os.fspath(a) TypeError: expected str, bytes or os.PathLike object, not NoneType

Python 3.6.7
Ubuntu 16.04

made-by-chris avatar May 21 '20 16:05 made-by-chris

I think its because initial args are missing

made-by-chris avatar May 21 '20 16:05 made-by-chris

It would be really great to have a full example of the python ./LSP_train.py command with all required commands. My current experience of this is just jumping from error to error trying to guess which arguments are necessary. Thanks a lot.

made-by-chris avatar May 27 '20 07:05 made-by-chris

I'm now just running a modified version of demo.py, with the default "train.tsv" replaced with my own tsv file. I get as far as this:

root@bl:/workspace# python demo.py 
PROJECT_FOLDER = /workspace
Found existing models folder at /workspace/models, skip creating a new one!
05/27/2020 08:44:53 - INFO - __main__ -   Downloading models...
05/27/2020 08:44:53 - INFO - demo_utils -   /workspace/models/small/config.json exists, return!
05/27/2020 08:44:53 - INFO - demo_utils -   /workspace/models/small/vocab.json exists, return!
05/27/2020 08:44:53 - INFO - demo_utils -   /workspace/models/small/merges.txt exists, return!
05/27/2020 08:44:53 - INFO - demo_utils -   /workspace/models/small/pytorch_model.bin exists, return!
05/27/2020 08:44:53 - INFO - demo_utils -   /workspace/models/small/small_ft.pkl exists, return!
05/27/2020 08:44:53 - INFO - __main__ -   Done!

05/27/2020 08:44:53 - INFO - __main__ -   Downloading and Extracting Data...
05/27/2020 08:44:53 - INFO - __main__ -   Preparing Data...
prepro.py --corpus /workspace/data/pdp.tsv --max_seq_len 128
^[[Ferror occurred, b'Traceback (most recent call last):\n  File "prepro.py", line 221, in <module>\n    main(args)\n  File "prepro.py", line 158, in main\n    raise ValueError(\'Found existing DB, please backup\')\nValueError: Found existing DB, please backup\n'

made-by-chris avatar May 27 '20 09:05 made-by-chris

Hi, you may need to first delete the existing db before creating a new one with the same output path.

dreasysnail avatar Jun 01 '20 22:06 dreasysnail