Converting model to Pytorch
Hi @arashno ,
I need to convert your res152 recognition model to pytorch. I am using mmdnn for conversion, but I cannot find the output node which needs to be given to the mmdnn conversion command. I have visualized the graph using the meta file, and there is no name that looks like output, softmax or predictions.
Can you or anyone else help with the conversion?
Hi, For the recognition only model, the output node of the ResNet-152 model is the fully connected layer at resnet.py line 53. I think the name of the output node should be: 'output:0'. For the model with identifying, counting, and additional attributes outputs, the name of the species recognition output node should be 'output0:0' Best, Arash
I have tried output:0 with the following command:
mmconvert -sf tensorflow -in snapshot-55.meta -iw snapshot-55 --dstNode output:0 -df pytorch -om serengeti_resnet_152.pth
but it gives me the error that node is not in the graph.
AssertionError: output:0 is not in graph
Actually, I am going to release a new version of this repo with new features in a few days. I will check convertibility to PyTorch for the new version. Please wait until I release the new version. Thanks, Arash
Unfortunately, I was unable to convert the Tensorflow models to PyTorch. But, the good news is that I will release a PyTorch version in 1-2 weeks. I finished the coding and now I am doing testing and preparing the trained models now. Arash
Just wondering what became of this?
@arashno : Did you ever release a PyTorch version?
@gullalc : It appears that valid node names for mmconvert include
'output0/weights/Initializer/truncated_normal/shape'
'output0/weights/Initializer/truncated_normal/mean'
'output0/weights/Initializer/truncated_normal/stddev'
'output0/weights/Initializer/truncated_normal/TruncatedNormal'
'output0/weights/Initializer/truncated_normal/mul'
'output0/weights/Initializer/truncated_normal'
'output0/weights'
'output0/weights/Assign'
'output0/weights/read'
'output0/weights/Regularizer/l2_regularizer/L2Loss'
'output0/weights/Regularizer/l2_regularizer'
'output0/biases/Initializer/Const'
'output0/biases'
'output0/biases/Assign'
'output0/biases/read'
'output0/weights/Momentum/Initializer/Const'
'output0/weights/Momentum'
'output0/weights/Momentum/Assign'
'output0/weights/Momentum/read'
'output0/biases/Momentum/Initializer/Const'
'output0/biases/Momentum'
'output0/biases/Momentum/Assign'
'output0/biases/Momentum/read'
Hi, Yes, the PyTorch version is available at https://github.com/arashno/pytorch_multigpu_csv But, unfortunately, I didn't have enough computational resources to train a full model. If you have access to enough computational power, I am up to improving the PyTorch repository.