You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
The example/warpctc/ocr_predict.py has a bug, it does not provide init_states values and run the ocr_predict.py several times and will get different results.
#5047
For bugs or installation issues, please provide the following information.
The more information you provide, the more likely people will be able to help you.
Environment info
Operating System:ubuntu
Compiler: gcc
Package used (Python/R/Scala/Julia):
MXNet version:
Or if installed from source:
MXNet commit hash (git rev-parse HEAD):
If you are using python package, please provide
Python version and distribution:
If you are using R package, please provide
R sessionInfo():
Error Message:
Please paste the full error message, including stack trace.
Minimum reproducible example
if you are using your own code, please provide a short script that reproduces the error.
Steps to reproduce
or if you are running standard examples, please provide the commands you have run that lead to the error.
1.Run the predict.py several time and get different results.
2.It does not provide init_states values for the lstm .
3.
What have you tried to solve it?
1.The init_states values should be provided.
2.first, init_states could be a var of class.
little changes in def __init_ocr(self):
self.init_states = init_c + init_h
all_shapes = [('data', (batch_size, 41 * 64))] + self.init_states + [('label', (batch_size, num_label))]
#print (all_shapes)
3. Provide the init_state values
#init_state_arrays = [mx.nd.zeros(x[1]) for x in self.init_states]
init_state_arrays = np.zeros((batch_size, num_hidden), dtype="float32")
init_state_dict={}
for x in self.init_states:
init_state_dict[x[0]] = init_state_arrays
self.predictor.forward(data= img1, **init_state_dict)
The text was updated successfully, but these errors were encountered:
I think I have the similar problem with a cnn-lstm-ctc task when using predict API to infer the results after training. The accuracy does not match when using the same dataset and checkpoint in and training.
For bugs or installation issues, please provide the following information.
The more information you provide, the more likely people will be able to help you.
Environment info
Operating System:ubuntu
Compiler: gcc
Package used (Python/R/Scala/Julia):
MXNet version:
Or if installed from source:
MXNet commit hash (
git rev-parse HEAD
):If you are using python package, please provide
Python version and distribution:
If you are using R package, please provide
R
sessionInfo()
:Error Message:
Please paste the full error message, including stack trace.
Minimum reproducible example
if you are using your own code, please provide a short script that reproduces the error.
Steps to reproduce
or if you are running standard examples, please provide the commands you have run that lead to the error.
1.Run the predict.py several time and get different results.
2.It does not provide init_states values for the lstm .
3.
What have you tried to solve it?
1.The init_states values should be provided.
2.first, init_states could be a var of class.
little changes in def __init_ocr(self):
self.init_states = init_c + init_h
all_shapes = [('data', (batch_size, 41 * 64))] + self.init_states + [('label', (batch_size, num_label))]
#print (all_shapes)
3. Provide the init_state values
#init_state_arrays = [mx.nd.zeros(x[1]) for x in self.init_states]
init_state_arrays = np.zeros((batch_size, num_hidden), dtype="float32")
init_state_dict={}
for x in self.init_states:
init_state_dict[x[0]] = init_state_arrays
self.predictor.forward(data= img1, **init_state_dict)
The text was updated successfully, but these errors were encountered: