Skip to content

FileNotFoundError: Couldn't find any class folder in /content/train2014. #1039

Open
@sevaroy

Description

@sevaroy

Your issue may already be reported!
Please search on the issue tracker before creating one.

I wanna train new style model
run this cmd

!unzip train2014.zip -d /content

!python /content/examples/fast_neural_style/neural_style/neural_style.py train --dataset /content/train2014 --style-image /content/A.jpg --save-model-dir /content --epochs 2 --cuda 1

Context

  • Pytorch version:
  • Operating System and version:

Your Environment

Colab
https://colab.research.google.com/github/pytorch/xla/blob/master/contrib/colab/style_transfer_inference.ipynb#scrollTo=EozMXwIV9iOJ

got this error

Traceback (most recent call last):
File "/content/examples/fast_neural_style/neural_style/neural_style.py", line 249, in
main()
File "/content/examples/fast_neural_style/neural_style/neural_style.py", line 243, in main
train(args)
File "/content/examples/fast_neural_style/neural_style/neural_style.py", line 43, in train
train_dataset = datasets.ImageFolder(args.dataset, transform)
File "/usr/local/lib/python3.7/dist-packages/torchvision/datasets/folder.py", line 316, in init
is_valid_file=is_valid_file,
File "/usr/local/lib/python3.7/dist-packages/torchvision/datasets/folder.py", line 145, in init
classes, class_to_idx = self.find_classes(self.root)
File "/usr/local/lib/python3.7/dist-packages/torchvision/datasets/folder.py", line 219, in find_classes
return find_classes(directory)
File "/usr/local/lib/python3.7/dist-packages/torchvision/datasets/folder.py", line 43, in find_classes
raise FileNotFoundError(f"Couldn't find any class folder in {directory}.")
FileNotFoundError: Couldn't find any class folder in /content/train2014.

How can I fix it?
thx

Metadata

Metadata

Assignees

Labels

bugdatarelated to data source, dataset, dataloader etc.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions