Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError while converting PyTorch model to IR #926

Open
JoMe2704 opened this issue Jun 30, 2021 · 0 comments
Open

KeyError while converting PyTorch model to IR #926

JoMe2704 opened this issue Jun 30, 2021 · 0 comments

Comments

@JoMe2704
Copy link

Platform: Win10

Python version: 3.8.5

Source framework with version: PyTorch (torch 1.7.1+cpu)

Destination framework with version: IR

Pre-trained model path: https://drive.google.com/drive/folders/1CXsEL_qUefIHrjVaBH1-Zf7LjKoBEKGL?usp=sharing

Running scripts: mmtoir -f pytorch -d cavaface --inputShape 3,112,112 -n IR-100_entire_model.pth

Output:
Traceback (most recent call last):
File "c:\program files\python38\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\program files\python38\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Program Files\Python38\Scripts\mmtoir.exe_main
.py", line 7, in
File "c:\program files\python38\lib\site-packages\mmdnn\conversion_script\convertToIR.py", line 200, in _main
ret = _convert(args)
File "c:\program files\python38\lib\site-packages\mmdnn\conversion_script\convertToIR.py", line 123, in _convert
parser.run(args.dstPath)
File "c:\program files\python38\lib\site-packages\mmdnn\conversion\common\DataStructure\parser.py", line 22, in run
self.gen_IR()
File "c:\program files\python38\lib\site-packages\mmdnn\conversion\pytorch\pytorch_parser.py", line 106, in gen_IR
func(current_node)
File "c:\program files\python38\lib\site-packages\mmdnn\conversion\pytorch\pytorch_parser.py", line 238, in rename_Conv
weights_scope = self.get_weight_name(source_node)
File "c:\program files\python38\lib\site-packages\mmdnn\conversion\pytorch\pytorch_parser.py", line 527, in get_weight_name
return self.pytorch_graph.layer_weight_map[node.name]
KeyError: 'node1085'

Note: In convertToIR.py, I included the lines
sys.path.append('path/to/folder/with/resnet_irse.py')
import resnet_irse
to ensure that this module defining the network structure is loaded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant