-
Notifications
You must be signed in to change notification settings - Fork 34
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
Load RadImageNet weigths for pytorch #3
Comments
Any version of tensorflow greater than 2 would be fine. I tested to load the model with tf 2.6 in kaggle environment, it loaded w/o any issue. I uploaded the pretrained weight here for easier use. You can check this |
Here is a rough code to transfer keras RadImageNet-ResNet50 model to pytorch, hope it help
|
Maybe it is interesting to have official support for Pytorch weights and possibly make them easy to use, as the pre-trained models from |
I think here it is missing to convert the batchnorm layers, right? |
Hi, the author of brain generation diffusion : ) We had a little chat on twitter about "generating the brain with lesions", remember? About your question, I tried to transfer the batchnorm parameters but failed (I vaguely remember it could not be done techniqually, due to the different implementations of ResNet in keras and pytorch ), and also I find the influence is not big (at least on my own dataset). |
Hi Junde! Yes, I do (btw, congratulations on your MedSegDiff paper! it looks great ^^). Thanks for sharing your experience! I have been trying to change the backend of these models and have been finding several differences between the implementation from Keras applications and Torchvision (for example, Keras version has bias, and I guess it is based on version 1 from ResNet, while the torchvision is based on version1.5). I hope to add more details here in the next few days. For the batchnorm, I have been using:
|
I am trying to convert the InceptionV3 weights to Pytorch to extract features for computing FID. |
Hey, are there any updates for the weights in pytorch? This solution doesn't work for me. There are some missing weights. |
It is true that the weights are not converted properly with this method. On the other hand, it seems that the proper model can also be obtained in pytorch if the conversion is done via onnx. Here is the code, which I share with you. |
I was trying to load the weights from 'RadImageNet-ResMet50_notop.h5' to use them in pytorch. Is there any version of pretrained weights from RadImageNet for pytorch?
Also, is it possible to know the tensorflow and keras version used to train those CNNs? Could you provide a requirement.txt file?
The text was updated successfully, but these errors were encountered: