Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alekseynp/keras-torchvision
https://github.com/alekseynp/keras-torchvision
keras neural-networks pretrained-models pytorch tensorflow
Last synced: 13 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/alekseynp/keras-torchvision
- Owner: alekseynp
- License: mit
- Created: 2018-02-05T21:48:19.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-06T22:59:51.000Z (almost 7 years ago)
- Last Synced: 2024-12-13T17:10:26.257Z (27 days ago)
- Topics: keras, neural-networks, pretrained-models, pytorch, tensorflow
- Language: Python
- Size: 229 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# keras-torchvision
Convert the pretrained resnet models from Pytorch's torchvision module for use in Keras with the Tensorflow backend (resnet18, resnet34, resnet50, resnet101, resnet152)
Divided into two scripts, using numpy files as an interchange medium. This makes it possible to have Pytorch and Tensorflow in two different environments.
Converts with anal attention to detail, matching activations at each layer. Picky about how 'same' padding is implemented.
`torchvision_resnet.py` implemented to read very similarly to `pytorch/vision/torchvision/models/resnet.py`
Usage:
```
python resnet_pytorch_to_numy.py 18
python resnet_numpy_to_keras.py 18python
import keras
keras.load_model('resnet18.h5')
```Validation:
![Test Image](test_image.png)
![Resnet18](resnet18.png)
![Resnet34](resnet34.png)
![Resnet50](resnet50.png)
![Resnet101](resnet101.png)
![Resnet152](resnet152.png)Tested:
- Kears 2.1.2
- Tensorflow 1.4.1
- Pytorch 0.2.0_3
- Cuda 7.5