Updating A File For An Imported Module


#1

I’m trying to use the BERT example provided on Colab here: https://colab.research.google.com/github/google-research/bert/blob/master/predicting_movie_reviews_with_bert_on_tf_hub.ipynb#scrollTo=dCpvgG0vwXAZ

The problem I’m running into is when I run the line:

from bert import run_classifier

I get the following error message:

AttributeError: module 'tensorflow_core._api.v2.train' has no attribute 'Optimizer'

According to the issue raised on GitHub, I need to change the following line:

 87 class AdamWeightDecayOptimizer(tf.train.Optimizer):

to:

tf.keras.optimizers.Optimizer

Is it possible to make a change to an installed library on Paperspace Gradient?

Right now I’m using Gradient, free plan, with the Deepo container.


#2

@JonathanBechtel Absolutely! Feel free to make any change to the framework or libraries that come pre-installed with the Deepo container. One of the advantages of Gradient is that any change you make to the system eg updating a library, adding a new one, etc., will be persisted.

Hope that helps!