texture_nets icon indicating copy to clipboard operation
texture_nets copied to clipboard

How to Set Up Training Data

Open alexblickenstaff opened this issue 9 years ago • 5 comments

I'm trying to train a style image using the MS COCO dataset but am having trouble setting up the directories in the proper way. I tried to follow your instructions in the README and have the following structure:

image-training/
image-training/train
image-training/train/dummy (images are in this folder)
image-training/val
image-training/val/dummy (images are in this folder)

When I run this command th train.lua -data image-training/ -style_image data/textures/cezanne.jpg, I get the following error:

/root/torch/install/bin/luajit: /root/texture_nets/datasets/style-gen.lua:67: class not found: val

Do you know if the structure of my image-training folder is incorrect?

alexblickenstaff avatar Aug 03 '16 07:08 alexblickenstaff

Thank you. This is the directory structure that worked for me. Notice the val folder has nothing inside of it; not even an empty folder.

image-training/
image-training/train
image-training/train/dummy (images are in this folder)
image-training/val

alexblickenstaff avatar Aug 18 '16 15:08 alexblickenstaff

Using the structure I just posted worked actually (with no empty folder in val).

alexblickenstaff avatar Aug 18 '16 15:08 alexblickenstaff

Same - was getting error with dummy folder inside of val. Removed dummy folder and now it works.

systemride avatar Dec 16 '16 22:12 systemride

What command are you inputting in the command line?

I am putting (After following the exact instructions): th train.lua -data dataset -style_image data/textures/red-peppers256.o.jpg

dataset/train dataset/train/dummy dataset/train/dummy/train2014/ dataset/val dataset/val/dummy/ dataset/val/dummy/val2014/

and I get this error:

=> Generating list of images	
 | finding all validation images	
find: `standard output': Broken pipe
find: write error
/home/arturo/torch/install/bin/luajit: ..._Project/texture_nets-master/datasets/style-gen.lua:67: class not found: val2014
stack traceback:
	[C]: in function 'assert'
	..._Project/texture_nets-master/datasets/style-gen.lua:67: in function 'findImages'
	..._Project/texture_nets-master/datasets/style-gen.lua:102: in function 'exec'
	./datasets/init.lua:28: in function 'create'
	./dataloader.lua:24: in function 'create'
	train.lua:111: in main chunk
	[C]: in function 'dofile'
	...turo/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
	[C]: at 0x00406670

ArturoDeza avatar Apr 08 '17 23:04 ArturoDeza

@ArturoDeza Hi, try to move everything from dataset/train/dummy/train2014 folder to dataset/train/dummy and remove train2014. Same with validation.

DmitryUlyanov avatar Apr 09 '17 14:04 DmitryUlyanov