pytorch-UNet icon indicating copy to clipboard operation
pytorch-UNet copied to clipboard

Error in dataset.py after running training cmd

Open daddydrac opened this issue 5 years ago • 3 comments

I ran:

python train.py --train_dataset images_folder/ --device 'cuda:0' --epochs 10 --save_freq 1 --save_model 1 --model_name round1 --crop 2560 --learning_rate 0.0001 --checkpoint_path checkpoint

Error output:

Traceback (most recent call last):
  File "train.py", line 40, in <module>
    val_dataset = ImageToImage2D(args.val_dataset, tf_val)
  File "/unet/pytorch-UNet/unet/dataset.py", line 122, in __init__
    self.input_path = os.path.join(dataset_path, 'images')
  File "/anaconda3/lib/python3.7/posixpath.py", line 80, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType

daddydrac avatar Dec 15 '19 17:12 daddydrac

Having same issue , in python 3.7 and 2.7

getcontrol avatar Dec 15 '19 19:12 getcontrol

@getcontrol just use mine, it actually works: https://github.com/joehoeller/legendary-palm-tree

daddydrac avatar Feb 14 '20 12:02 daddydrac

@joehoeller @getcontrol The path of val dataset is required, change the command as follow: python train.py
--train_dataset images_folder/
--val_dataset images_folder_2/ . # Added Line --device 'cuda:0' --epochs 10
--save_freq 1 --save_model 1
--model_name round1 --crop 256
--learning_rate 0.0001
--checkpoint_path checkpoint

Beanocean avatar Feb 29 '20 16:02 Beanocean