torch2coreml
torch2coreml copied to clipboard
ValueError: expected 5D input (got 4D input)
Hello!,how to solve this problem,thank you very much!
Preparing models for conversion
Converting models to CoreML
Converting prepared_models/candy.t7
Traceback (most recent call last):
File "convert-fast-neural-style.py", line 176, in
The CoreML model can be generated after you reshape (N,C,H,W) to (N,C,1,H,W), but the result was terrible, at last I used 'Batch Normalization' instead of 'Instance Normalization' and it worked well.
Hello!Thank you for your reply,’'Batch Normalization' instead of 'Instance Normalization' ‘,how to do that?Can you explain it in detail or show it with pictures,thank you very much!
发自我的 iPhone
在 2018年8月23日,上午12:05,GordonRen [email protected] 写道:
'Batch Normalization' instead of 'Instance Normalization'
1.find 'train.lua' 2.set cmd:option('-use_instance_norm', 1) to cmd:option('-use_instance_norm', 0) 3.train Notice:the trained model uses 'Instance Normalization' which has something wrong when converting it to CoreML model, but you can trian your model using ‘Batch Normalization' and Convert it to CoreML model successfully.
Ok, thank you very much! I try it now.
发自我的 iPhone
在 2018年8月23日,上午12:19,GordonRen <[email protected]mailto:[email protected]> 写道:
1.find 'train.lua' 2.set cmd:option('-use_instance_norm', 1) to cmd:option('-use_instance_norm', 0) 3.train Notice:the trained model uses 'Instance Normalization' which has something wrong when converting it to CoreML model, but you can trian your model using ‘Batch Normalization' and Convert it to CoreML model successfully.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/prisma-ai/torch2coreml/issues/27#issuecomment-415091202, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFb83Z469sVIrbNJneckQtG1R38Pzpl3ks5uTYR6gaJpZM4VNXFc.