Closed mzhaoshuai closed 6 years ago
Yes, you are right. That is a bug :sweat_smile:. I've fixed it in the code. Thanks for pointing it out!
What do you mean with
the two number is same, it is all right
? Did you set the first line to 2 2
or 1 1
and it worked?
Before the bug is fixed, the code can run successfully when the first line in the csv
file hvae two same numbers. It means the number of the regions is same as the max number of the characters.
This is an interesting coincidence. When num_chars = num_timesteps
, the sequence do not matter.
This is waht I want to express. Please pardon me for the unclear expression. I am not a native English speaker...so, you know, it is hard to express properly.
Thanks for your work again!
Ah, okay now I get it :smile:! Thanks again for pointing out the bug!
When I try to use the
centered
dataset(I download this dataset from the address you provided) to train a model from scratch, I run thetrain_svhn.py
and meet the error: ps : The first line of thecsv
file is1 2
.I add those code to print the related information in the
calc_loss
method of the classSVHNSoftmaxMetrics
:The reasonable result may be :
Now they are not matched, and I see the hint of the error,
200! = 400
, so I think the shape of the prediction may have some problem. So I see the source code of__call__
method of theSVHNRecognitionNet
class in thesvhn.py
,it shows:The code
concat
on theaxis=0
. So the shape of the entry in the listoverall_predictions
maybe like[num_chars, batch_szie, num_classes]
. The number(or the length of the list) of entry in the list isnum_timesteps
.And in the
calc_loss
method of theSVHNSoftmaxMetrics
class in thesvhn_softmax_metrics.py
, the code is like:The code
expand_dims
andconcat
on theaxis=2
, so the final dims of thebatch_predictions
may be like[num of chars, batch_size, num_timesteps, num_classes]
. But according to the context, the expected dim of thebatch_predictions
may be[num_timesteps, bath_size, num_chars, num_classes]
. So I add one line:And it works, no error. I train a nice model.
When the first line of the
csv
file is likea a
, the two number is same, it is all right.Do this is really a bug?
Finally, thanks for your work ! It is a good paper.