-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem in evaluation after training the model #24
Comments
This is interesting. The code should actually create a file called The second error you get is because you are trying to load the wrong model. Instead of |
Thanks for the quick reply @Bartzi . As you instructed the above problem solved. But the following error is coming. This error might be of chainer. python SEE_unziped/SEE/see-master/chainer/evaluate.py --gpu 0 'svhn' "/content/SEE_unziped/SEE/2018-04-12T05:08:15.296708_training" "trainer_snapshot" "/content/SEE_unziped/SEE/test.tar/test/test/cropped/test.csv" "/content/SEE_unziped/SEE/see-master/datasets/svhn/svhn_char_map.json" 2 /usr/local/lib/python3.6/dist-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`. from ._conv import register_converters as _register_converters 0%| | 0/13068 [00:00 evaluator.evaluate() File "/content/SEE_unziped/SEE/see-master/chainer/evaluation/evaluator.py", line 114, in evaluate predictions, crops, grids = self.net(image[self.xp.newaxis, ...]) File "/content/SEE_unziped/SEE/see-master/chainer/models/svhn.py", line 209, in __call__ h = self.localization_net(images) File "/content/SEE_unziped/SEE/see-master/chainer/models/svhn.py", line 60, in __call__ lstm_prediction = F.relu(self.lstm(in_feature)) File "/usr/local/lib/python3.6/dist-packages/chainer/links/connection/lstm.py", line 309, in __call__ lstm_in = self.upward(x) File "/usr/local/lib/python3.6/dist-packages/chainer/links/connection/linear.py", line 129, in __call__ return linear.linear(x, self.W, self.b) File "/usr/local/lib/python3.6/dist-packages/chainer/functions/connection/linear.py", line 234, in linear y, = LinearFunction().apply(args) File "/usr/local/lib/python3.6/dist-packages/chainer/function_node.py", line 240, in apply self._check_data_type_forward(in_data) File "/usr/local/lib/python3.6/dist-packages/chainer/function_node.py", line 321, in _check_data_type_forward self.check_type_forward(in_type) File "/usr/local/lib/python3.6/dist-packages/chainer/functions/connection/linear.py", line 23, in check_type_forward x_type.shape[1] == w_type.shape[1], File "/usr/local/lib/python3.6/dist-packages/chainer/utils/type_check.py", line 524, in expect expr.expect() File "/usr/local/lib/python3.6/dist-packages/chainer/utils/type_check.py", line 482, in expect '{0} {1} {2}'.format(left, self.inv, right)) chainer.utils.type_check.InvalidType: Invalid operation is performed in: LinearFunction (Forward) Expect: in_types[0].shape[1] == in_types[1].shape[1] Actual: 192 != 5808 I need to clear one thing what is num_labels signifies? Is it the number of max number of digits in house number detected in the image. What will be the good value for it. or we can give any value? |
I think you receive this error, because the dimensions of your input images are not correct, at least they are not resized to the size expected by the model. You could try to check that. Regarding |
Thanx @Bartzi the evaluation is executing fine. But every time it is predicting label = 1 for any digit. And for all the image I am getting only 1 label. e.g. for 210 in image I am getting word = 1 and gt_word = 2. Is it because I have taken --timesteps 1. What --timesteps signifies?? |
|
But I am getting word = 1 for every image. I have taken --timesteps = 1 |
Hi @Bartzi Sorry for a lot of issues. But I have trained the SVHN and there is problem in evaluation because of the issue of the parameters. Can u please share the parameters value you have choosen for training and evaluation of the SVHN dataset. It will be a great favor. Thanks |
Sure no problem, but you already said that you trained a SVHN model. Could you post the command-line you used to train the model and also the |
Hi @Bartzi I followed the readme and try to build a SVHN model. I downloaded the datasets here and train the model using the datasets in the generated/easy folder. Expect: in_types[0].shape[1] == in_types[1].shape[1] |
Hmm, okay... could you provide the exact calls you used to start the |
My calls for training is |
Hello @Bartzi @saq1410 , sorry to bother both of you.
|
@wyh410 you are using @Jacoobr hmm, looks like you changed something in the evaluation code? In your code the wrong evaluator is called. You seem to be using the standard evaluator instead of the |
Hi, @Bartzi , thanks for your reply . I changed nothing in the evaluation code. Now, I try to figure out which evaluator called when i run the evaluation command as I said and the output the value of evaluator of line 73 in the script evaluate.py is: |
That's very interesting. You seem to have code that is different to the code on github, because the line numbers did not match, as I was checking the code. That's all I can tell you right now. |
hello, @Bartzi , thanks for your reply. I go through the code and find the data variable (line 150 code) un changed when the line code is executed (code ) , so i changed the code of line 149 like this:
Can you help me with this proble? What's more the |
Hmm, Furthermore: Did you change this line? You have to set Those changes change the size of the arrays you are using and should thus help you to get the right shape, the code is expecting. |
Hi @Bartzi , i didn't change this line code and change nothing of this script. Now, i set |
Hmm, there is one more thing I can think of. While looking at the code, I see that the images for training the network are not automatically resized to be of size |
Hi,
I have trained the model on SVHN dataset. I have trained the model on google colab notebook. After training the model the following directory created.
NOTE: I have trained the model with batch size 8 because of the memory limitations in google colab.
But after running the evaluate.py with the below command it is looking for svhn.py in the model directory and gives the error. But the created file is train_svhn.py
So I renamed the file from train_svhn.py to svhn.py. After renaming the file the above error gone but this new error is coming.
The text was updated successfully, but these errors were encountered: