cchen156 / Learning-to-See-in-the-Dark

Learning to See in the Dark. CVPR 2018
http://cchen156.web.engr.illinois.edu/SID.html
MIT License
5.46k stars 842 forks source link

how to convert these tensorflow models into caffe? #80

Open Zhang-Jack opened 5 years ago

Zhang-Jack commented 5 years ago

When I trying to convert these pre-trained model into caffe by using a Microsoft tool named MMdnn, I just got the error below: Platform: Ubuntu 18.04

Python version: 3.7.3

Source framework with version : Tensorflow 1.13.1 with GPU

Destination framework with version: Caffe 1.0 with GPU

Pre-trained model path : you can get them through the commands below: git clone https://github.com/cchen156/Learning-to-See-in-the-Dark.git python download_models.py

Running scripts: cd checkpoint/Sony mmconvert -sf tensorflow -in model.ckpt.meta -iw model.ckpt --dstNode Mean -df caffe -om Sony.caffemodel

Warning: Graph Construct a self-loop node g_conv4_1/Maximum. Ignored. Warning: Graph Construct a self-loop node g_conv4_2/Maximum. Ignored. Warning: Graph Construct a self-loop node g_conv4_2/Maximum. Ignored. Warning: Graph Construct a self-loop node g_conv5_1/Maximum. Ignored. Warning: Graph Construct a self-loop node g_conv5_2/Maximum. Ignored. Warning: Graph Construct a self-loop node g_conv4_2/Maximum. Ignored. Warning: Graph Construct a self-loop node g_conv6_1/Maximum. Ignored. Warning: Graph Construct a self-loop node g_conv6_2/Maximum. Ignored. Warning: Graph Construct a self-loop node g_conv3_2/Maximum. Ignored. Warning: Graph Construct a self-loop node g_conv7_1/Maximum. Ignored. Warning: Graph Construct a self-loop node g_conv7_2/Maximum. Ignored. Warning: Graph Construct a self-loop node g_conv2_2/Maximum. Ignored. Warning: Graph Construct a self-loop node g_conv8_1/Maximum. Ignored. Warning: Graph Construct a self-loop node g_conv8_2/Maximum. Ignored. Warning: Graph Construct a self-loop node g_conv1_2/Maximum. Ignored. Warning: Graph Construct a self-loop node g_conv9_1/Maximum. Ignored. Warning: Graph Construct a self-loop node g_conv9_2/Maximum. Ignored. Warning: Graph Construct a self-loop node DepthToSpace. Ignored. Traceback (most recent call last): File "/home/ljack6996/anaconda3/bin/mmconvert", line 10, in sys.exit(_main()) File "/home/ljack6996/anaconda3/lib/python3.7/site-packages/mmdnn/conversion/_script/convert.py", line 108, in _main ret = IRToCode._convert(code_args) File "/home/ljack6996/anaconda3/lib/python3.7/site-packages/mmdnn/conversion/_script/IRToCode.py", line 61, in _convert emitter.run(args.dstModelPath, args.dstWeightPath, args.phase) File "/home/ljack6996/anaconda3/lib/python3.7/site-packages/mmdnn/conversion/caffe/caffe_emitter.py", line 144, in run super(CaffeEmitter, self).run(dstNetworkPath, dstWeightPath, phase) File "/home/ljack6996/anaconda3/lib/python3.7/site-packages/mmdnn/conversion/common/DataStructure/emitter.py", line 22, in run self.save_code(dstNetworkPath, phase) File "/home/ljack6996/anaconda3/lib/python3.7/site-packages/mmdnn/conversion/common/DataStructure/emitter.py", line 59, in save_code code = self.gen_code(phase) File "/home/ljack6996/anaconda3/lib/python3.7/site-packages/mmdnn/conversion/caffe/caffe_emitter.py", line 132, in gen_code func(current_node) File "/home/ljack6996/anaconda3/lib/python3.7/site-packages/mmdnn/conversion/caffe/caffe_emitter.py", line 197, in emit_Conv pad_h, pad_w = self._get_symmetric_padding(IR_node) File "/home/ljack6996/anaconda3/lib/python3.7/site-packages/mmdnn/conversion/caffe/caffe_emitter.py", line 160, in _get_symmetric_padding if IR_parent_node.type == 'Pad': AttributeError: 'NoneType' object has no attribute 'type'

Would you please help me to figure out how to fix it? Thank you in advance!