MMdnn icon indicating copy to clipboard operation
MMdnn copied to clipboard

KeyError while converting PyTorch model to IR

Open JoMe2704 opened this issue 4 years ago • 0 comments

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

JoMe2704 avatar Jun 30 '21 07:06 JoMe2704