zahlii / colab-tf-utils Goto Github PK
View Code? Open in Web Editor NEWAutomatically backup keras/tensorflow models from Google's Colab service to your GoogleDrive based on a keras callback!
License: GNU General Public License v3.0
Automatically backup keras/tensorflow models from Google's Colab service to your GoogleDrive based on a keras callback!
License: GNU General Public License v3.0
I am getting this error many times. Sometimes, after 10-12 epochs, it begins uploading but sometimes it doesn't upload anything. Any idea ?
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/Users/georgezagraid/Projects/AI/Projects/binary_LSTM/load_model.py", line 69, in <module>
model = load_model(os.path.join(os.path.dirname(__file__),"models/RNN_Final_0.62.model"))
File "/anaconda3/lib/python3.6/site-packages/tensorflow/python/keras/engine/saving.py", line 229, in load_model
model = model_from_config(model_config, custom_objects=custom_objects)
File "/anaconda3/lib/python3.6/site-packages/tensorflow/python/keras/engine/saving.py", line 306, in model_from_config
return deserialize(config, custom_objects=custom_objects)
File "/anaconda3/lib/python3.6/site-packages/tensorflow/python/keras/layers/serialization.py", line 64, in deserialize
printable_module_name='layer')
File "/anaconda3/lib/python3.6/site-packages/tensorflow/python/keras/utils/generic_utils.py", line 173, in deserialize_keras_object
list(custom_objects.items())))
File "/anaconda3/lib/python3.6/site-packages/tensorflow/python/keras/engine/sequential.py", line 293, in from_config
layer = layer_module.deserialize(conf, custom_objects=custom_objects)
File "/anaconda3/lib/python3.6/site-packages/tensorflow/python/keras/layers/serialization.py", line 64, in deserialize
printable_module_name='layer')
File "/anaconda3/lib/python3.6/site-packages/tensorflow/python/keras/utils/generic_utils.py", line 193, in deserialize_keras_object
function_name)
ValueError: Unknown layer:name
Getting this error when loading model with
from tensorflow.keras.models import load_model
Is it possible to save full model?
IndexError Traceback (most recent call last)
<ipython-input-22-543c5fbe3f75> in <module>()
166 epochs=EPOCHS,
167 validation_data=(validation_x, validation_y),
--> 168 callbacks=[utils.GDriveCheckpointer(compare,path)],
169 )
170
/content/utils.py in __init__(self, compare_fn, filepath_fn, save_optimizer)
161 super(GDriveCheckpointer, self).__init__()
162
--> 163 self.saver = GDriveSync()
164
165 self.compare_fn = compare_fn
/content/utils.py in __init__(self)
46
47 self.drive_service = build('drive', 'v3')
---> 48 self.default_folder = self.find_items('Colab Notebooks')[0]
49
50 def find_items(self, name):
IndexError: list index out of range
Code:
def compare(best, new):
return best.losses['val_acc'] < new.losses['val_acc']
def path(new):
if new.losses['val_acc'] > 0.5:
return 'RNN_Final_{0}.model'.format(new.losses['val_acc'])
# Train model callbacks=[tensorboard, checkpoint],
history = model.fit(
train_x, train_y,
batch_size=BATCH_SIZE,
epochs=EPOCHS,
validation_data=(validation_x, validation_y),
callbacks=[utils.GDriveCheckpointer(compare,path)]
)
Have no Idea why I'm getting this error.
Previously in code loaded GD service to load files, maybe this is hot spot:
auth.authenticate_user()
gauth = GoogleAuth()
gauth.credentials = GoogleCredentials.get_application_default()
drive = GoogleDrive(gauth)
f1 = drive.CreateFile({'id': 'id'})
f1.GetContentFile('file.csv')
Would be grateful for any help.
Hi, I am trying to use the code snippet for creating the callback but getting this error ->
NotFoundError: Container localhost does not exist. (Could not find resource: localhost/RMSprop_2/iterations)
Please can you help me?
two types of errors when I tried to execute
ImportError: No module named utils
and when i run again it was showing
ModuleNotFoundError Traceback (most recent call last)
in ()
7 import sys
8 import os
----> 9 import utils
10 import keras
ModuleNotFoundError: No module named 'utils'
I get the following error:
File "utils.py", line 62
def upload_file_to_folder(self, local_file, folder: GDriveItem = None):
^
SyntaxError: invalid syntax
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.