Exception in thread "main" ai.djl.translate.TranslateException: ai.djl.engine.EngineException: MXNet engine call failed: MXNetError: Check failed: (*in_type)[i] == dtype (0 vs. 3) : This layer requires uniform type. Expected 'uint8' v.s. given 'float32' at 'weight' #2695
Unanswered
DongXiaona123
asked this question in
Q&A
Replies: 1 comment 3 replies
-
The issue should be that there is a difference between the inputs given during training and during inference. You can try changing the third line to |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I did a training like pikachu and saved the training parameters ".params" file. My purpose is to identify the driver in the picture. Now I use my local model and start inference.I override processInput and processOutput in Translate. My input data is an image. After rewriting the processInput method, an error occurs, as follows(I don't understand what causes this. please help me):
Exception in thread "main" ai.djl.translate.TranslateException: ai.djl.engine.EngineException: MXNet engine call failed: MXNetError: Check failed: (*in_type)[i] == dtype (0 vs. 3) : This layer requires uniform type. Expected 'uint8' v.s. given 'float32' at 'weight'
Stack trace:
File "C:\source\mxnet\src\operator\nn\convolution.cc", line 301
Caused by: ai.djl.engine.EngineException: MXNet engine call failed: MXNetError: Check failed: (*in_type)[i] == dtype (0 vs. 3) : This layer requires uniform type. Expected 'uint8' v.s. given 'float32' at 'weight'
Stack trace:
File "C:\source\mxnet\src\operator\nn\convolution.cc", line 301
Mycode:
public static void main(String[] args) throws IOException, ModelException, TranslateException {
Engine engine = Engine.getEngine("MXNet");
Path modelPath = Paths.get("build/model");
Model model = Model.newInstance("driver-ssd");
model.setBlock(TrainDriver.getSsdTrainBlock());
model.load(modelPath);
Path imageFile = Paths.get("D:\1.jpg");
Image img = ImageFactory.getInstance().fromFile(imageFile);
SingleShotDetectionTranslator.Builder builder = SingleShotDetectionTranslator.builder()
.addTransform(new ToTensor())
.optSynset(Collections.singletonList("driver"))
.optThreshold(0.7f);
Beta Was this translation helpful? Give feedback.
All reactions