see icon indicating copy to clipboard operation
see copied to clipboard

I got a question about the train_svhn.py

Open zimo99 opened this issue 3 years ago • 6 comments

python train_svhn.py ../datasets/svhn/jsonfile/svhn_curriculum_specification.json ../datasets/svhn/runningLog/ -g 0 --char-map ../datasets/svhn/svhn_char_map.json -b 10 Traceback (most recent call last): File "train_fsns.py", line 84, in train_dataset, validation_dataset = curriculum.load_dataset(0) File "/home/donglong_5/SEE/see-master/chainer/utils/baby_step_curriculum.py", line 40, in load_dataset train_dataset = self.dataset_class(self.train_curriculum[level], **self.dataset_args) File "/home/donglong_5/SEE/see-master/chainer/datasets/file_dataset.py", line 31, in init self.num_timesteps, self.num_labels = (int(i) for i in next(reader)) File "/home/donglong_5/SEE/see-master/chainer/datasets/file_dataset.py", line 31, in self.num_timesteps, self.num_labels = (int(i) for i in next(reader)) ValueError: invalid literal for int() with base 10: '1 2'

zimo99 avatar Jun 22 '21 07:06 zimo99

Well, you did not separate the digits in the first line by a tab (\t). The csv needs to be a tsv.

Bartzi avatar Jun 22 '21 08:06 Bartzi

Thank you very much. I'll try it now.

zimo99 avatar Jun 22 '21 08:06 zimo99

When changed to tsv, like this: 4 4 /home/donglong_5/SEE/see-master/datasets/svhn/gridDataset/train/0.png 0 9 10 10 2 0 10 10 0 6 10 10 0 8 10 10 /home/donglong_5/SEE/see-master/datasets/svhn/gridDataset/train/1.png 0 9 10 10 0 1 10 10 4 4 10 10 8 10 10 10 ... But, after trying again, there was still problem: python train_svhn.py ../datasets/svhn/jsonfile/svhn_curriculum_specification.json ../datasets/svhn/runningLog/ -g 0 --char-map ../datasets/svhn/svhn_char_map.json --blank-label 0 -b 128 Traceback (most recent call last): File "train_svhn.py", line 76, in train_dataset, validation_dataset = curriculum.load_dataset(0) File "/home/donglong_5/SEE/see-master/chainer/utils/baby_step_curriculum.py", line 40, in load_dataset train_dataset = self.dataset_class(self.train_curriculum[level], **self.dataset_args) File "/home/donglong_5/SEE/see-master/chainer/datasets/file_dataset.py", line 31, in init self.num_timesteps, self.num_labels = (int(i) for i in next(reader)) File "/home/donglong_5/SEE/see-master/chainer/datasets/file_dataset.py", line 31, in self.num_timesteps, self.num_labels = (int(i) for i in next(reader)) ValueError: invalid literal for int() with base 10: '4 4'

(Ps:This is the changed JOSN file {         "train": "/home/donglong_5/SEE/see-master/datasets/svhn/gridDataset/train.tsv",         "validation": "/home/donglong_5/SEE/see-master/datasets/svhn/gridDataset/valid.tsv"     }

zimo99 avatar Jun 22 '21 08:06 zimo99

okay, did you also change the delimiter between all values in the tsv file? All items need to be delimited by a tab character.

Bartzi avatar Jun 22 '21 15:06 Bartzi

thank (^▽^)

zimo99 avatar Jun 23 '21 06:06 zimo99

I want to reproduce the results with 95.2% accuracy obtained in the paper(SVHN), but I don't quite understand which dataset use as a training set and a validation set, how do you get your val set and whether you can reproduce the results of the original paper?

WangzekunY avatar Nov 24 '21 01:11 WangzekunY