Open stereomatchingkiss opened 5 years ago
Hi @stereomatchingkiss , The --inputShape should be 3,112,112.
Hi @stereomatchingkiss , The --inputShape should be 3,112,112.
Thanks, the dimension problem solved, but I found new issues. When I convert the resnet34 models of insight face, I saw following warnings
C:\Users\yyyy\Anaconda3\lib\site-packages\mxnet\module\base_module.py:56: UserWarning: [91mYou created Module with Module(..., label_names=['softmax_label']) but input with name 'softmax_label' is not found in symbol.list_arguments(). Did you mean one of:
data[0m
warnings.warn(msg)
Warning: MXNet Parser has not supported operator null with name data.
Warning: convert the null operator with name [data] into input layer.
IR network structure is saved as [mobile_face_net.json].
IR network structure is saved as [mobile_face_net.pb].
IR weights are saved as [mobile_face_net.npy].
Although I can convert the models to IR files, but not sure this is safe or not
When I convert MobileFaceNet, saw error messages
C:\Users\yyyy\Anaconda3\lib\site-packages\mxnet\module\base_module.py:56: UserWarning: [91mYou created Module with Module(..., label_names=['softmax_label']) but input with name 'softmax_label' is not found in symbol.list_arguments(). Did you mean one of:
data[0m
warnings.warn(msg)
Warning: MXNet Parser has not supported operator null with name data.
Warning: convert the null operator with name [data] into input layer.
Traceback (most recent call last):
File "C:\Users\yyyy\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\yyyy\Anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\yyyy\Anaconda3\lib\site-packages\mmdnn\conversion\_script\convertToIR.py", line 197, in <module>
_main()
File "C:\Users\yyyy\Anaconda3\lib\site-packages\mmdnn\conversion\_script\convertToIR.py", line 192, in _main
ret = _convert(args)
File "C:\Users\yyyy\Anaconda3\lib\site-packages\mmdnn\conversion\_script\convertToIR.py", line 115, in _convert
parser.run(args.dstPath)
File "C:\Users\yyyy\Anaconda3\lib\site-packages\mmdnn\conversion\common\DataStructure\parser.py", line 22, in run
self.gen_IR()
File "C:\Users\yyyy\Anaconda3\lib\site-packages\mmdnn\conversion\mxnet\mxnet_parser.py", line 262, in gen_IR
func(current_node)
File "C:\Users\yyyy\Anaconda3\lib\site-packages\mmdnn\conversion\mxnet\mxnet_parser.py", line 398, in rename_FullyConnected
weight = self.weight_data.get(source_node.name + "_weight").asnumpy().transpose((1, 0))
AttributeError: 'NoneType' object has no attribute 'asnumpy'
Hi @stereomatchingkiss, this warning doesn't matter. I find there is no 'pre_fc1_weight' object in the self.weight_data. But I find the 'fc1_weight' in the self.weight_data in the shape of (128, 512). I think it may be the weight of the fully connected layer 'pre_fc1' which the num_hidden is 128. Maybe you can change this line:
weight = self.weight_data.get(source_node.name + "_weight").asnumpy().transpose((1, 0))
into
weight = self.weight_data.get(source_node.name.split('pre_')[-1] + "_weight").asnumpy().transpose((1, 0))
I tried, it works. Thanks!
@namizzz
I am able to convert mobilefacenet with your suggestion. My goal is to convert to pytorch or tensorflow. DO you know how to convert this IR model to tensorflow or pytorhc?
Thanks,
@namizzz
Do you know how to convert this IR model to tensorflow or pytorch?
Your help will be appreciated.
Thanks, FC
I got it converted to pytorch by using the below command
mmtocode -f pytorch -n mobile_face_net.pb -w mobile_face_net.npy -d torch_converted.py -dw torch_converted.pt
However the major issue is that PRelu operation is not yet supported as a pytorch emitter.
@namizzz Can you suggest what extra changes will have to be made for this model to be successfully converted to pytorch model
Thanks
Hi, any progress on this issue? I have a similar problem #499 @rainLiuplus @namizzz
Platform : win10 64 bits
Python version: Anaconda 3.6
Source framework with version: mxnet 1.3.0
Destination framework with version: Ultimate goal is convert to caffe model, but fail to convert to IR
Pre-trained model path : insight face model zoo, converting MobileFaceNet
Running scripts(try all of them):
Error message:
Any suggestions?Thanks