This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Step 1 | |
from google.colab import drive | |
drive.mount('/content/drive') | |
#Upload data to drive in directory ColabData | |
#Step 2 | |
import tensorflow as tf | |
print(tf.__version__) | |
#tensorflow.contrib is not there in 2.0 | |
#!pip install tensorflow==2.0.0 | |
#Downgrade tensorflow to 1.13.2 | |
#!pip install tensorflow==1.13.2 | |
#Step 3 | |
from tensorflow.contrib import lite | |
converter = tf.lite.TFLiteConverter.from_keras_model_file(r'/content/drive/My Drive/ColabData/model_landmark_vgg16.h5') | |
tflite_model = converter.convert() | |
open(r'/content/drive/My Drive/ColabData/model.tflite','wb').write(tflite_model) |
Happy Learning!!!
No comments:
Post a Comment