Getting dltargets.​internal.g​etNetworkI​nputSizes error when trying to quantize trained network

I used the Deep Network Designer app to train googlenet using transfer learning. The network works fine. When I open the Deep Network Quantizer app and select "new" no networks appear in the network list. Clicking refresh or selecting CPU doesn't affect it.
When I try to run dlquantizer in the command window with the network in the workspace I get the error:
Unable to resolve the name dltargets.internal.getNetworkInputSizes.
What am I doing wrong?
The network is a 1x1 DAGNetwork
Layers: [144×1 nnet.cnn.layer.Layer]
Connections: [170×2 table]
InputNames: {'data'}
OutputNames: {'classoutput'}
Thanks

 채택된 답변

Asvin Kumar
Asvin Kumar 2021년 5월 12일
편집: Asvin Kumar 2021년 5월 17일
[EDIT]
David figured out that he needed GPU Coder Interface for Deep Learning Libraries.
More details on the requirements for quantization are in the hyperlink.
~~~ Original Answer ~~~
Hi David,
Here's the workflow that works for me. I'm using R2021a. I, mostly, followed the steps in this example.
  1. Open Deep Network Designer (DND).
  2. Load pretrained googlenet.
  3. Modify the network to my training data.
  4. Load the training data.
  5. Train the network.
I assume it works for you as well until this point. If you try to load the trained network into Deep Network Quantizer (DNQ) at this stage, it would not be possible since DNQ loads networks/quantizer objects from the workspace. So, you should export from DND before importing into DNQ. Here are my next steps which worked.
  1. Export trained network to workspace from DND.
  2. Load network from workspace.
  3. Create a dlquantizer network using the exported trained network.
You might have had issues in loading the trained network into DNQ because it wasn't exported to the workspace yet from DND. I'm not sure why you're seeing the dltargets.internal.getNetworkInputSizes error. If you're still seeing it, please attach detailed reproduction steps. This question says you're on R2021a as well. Please confirm your release version once again so that I can try to recreate your error at my end.

댓글 수: 9

Thank you for your time! I am using R2021a. I was using GoogLeNet and have successfully trained the network and exported to the workspace. I see "trainedNetwork_1", "trainInfoStruct_1" and "net" in the workspace. When I save the workspace it creates a Matlab file. When I load that to the workspace it appears as the 3 objects again.
At this point the network works and I can use it to classify new data. But when I open Deep Network Quantizer app (with the trained netowrk objects in the workspace), I select new and there is nothing to choose from, just "Refresh List", which I click and it does nothing as well.
This led me to try quantizing the workspace in the command window and scripts which gets me the error.
Detailed:
load "deepnetwork3.mat" in command window. (My saved trained network)
net, trainedNetwork_1 and trainedInfoStruct_1 all appear in workspace
Open Deep Network Quantizer App
Click "New"
Where it says "network: No network is listed.
I select "Refresh LIst"
There is still no network to choose from.
My workspace still has net, trainedNetwork_1 and trainedInfoStruct_1 in it.
If I clear my workspace and reload the network to the workspace and open the deep network designer I am able to load the network. But in the deep network quantizer app no networks appear to load.
Could you share your saved MAT file? That might help reproduce this issue.
After using the deep network designer app and training googlenet to my data I get 3 files in the workspace:
net - 1x1 DAGNetwork
trainedNetwork_1 - 1x1 DAGNetwork
trainedInfoStruct_1 1x1 structure array with 7 fields
When I save these from the workspace it makes 1 .mat file. I tried to upload that but the file is 45 MB and the insert feature here limits you to 5MB. I just bring this up in case I am saving it wrong to upload or my file is unusually lage because of something else I did wrong. So it won't let me upload due to the size. I am including a pic of the workspace in case that helps. If I can upload the larger .mat file somewhere or send it to you I am happy to do that.
I am able to use the trained network to make predictions. But I am not able to get it to show up in the quantizer app.
Nope, you're not attaching wrong. You could try to provide a link via Drive/Dropbox.
If you're not comfortable with that, I'd recommend contacting your local tech support via phone/email. They should be able to help you out. I suspect this needs some back-and-forth communication. Plus, you can share your data over email.
I don't see any flags in your screenshot. I'm not sure yet what's causing the behaviour that you're seeing.
It turns out I am an idiot and had the wrong support package installed. I installed:
GPU Coder Interface for Deep Learning Libraries
Now it shows my network. Thank you for the help!!!
Hahaha I'm glad you figured it out. How'd you realize?
  1. How calm you are indicated I am making a dumb mistake and this shouldn't be very hard.
  2. I read about a sort of similar problem and they were missing a support pack
  3. I re-read (must be the 10th time) the workflow and saw I was missing the support package.
The search box in the "Get more apps" area is not your buddy. It doesn't corrolate package combos and is misleading/confusing (to me) sometimes [dlquantize is in deep learning doolbox. You search quantizer and that tool box pops up but the support packages don't.] If I search dlquantizer or something and all of this popped up it would help. Also there are instructions in the work flow that make you think only an intel procesor will work, but then after unnessesary research the architecture it needs in the intel chip is also on AMD and has been since Zen1. Just confusing is all. If you update your response to "check for missing[insert package name]' I would like to select it as the answer in case someone else ends up in the same boat as I did. Thanks again for all your time and help!
Updated. You can use the contact us link to create a service request where you can drop in your suggestions/ideas. :) Have a good day, David.
Thank you Asvin. Have a good day as well.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

제품

릴리스

R2021a

질문:

2021년 5월 9일

댓글:

2021년 5월 17일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by