googlecolab / colabtools

Python libraries for Google Colaboratory
Apache License 2.0
2.17k stars 705 forks source link

Colab's preinstalled TF 1.15 is missing tf.contrib module. #1081

Closed synergy178 closed 4 years ago

synergy178 commented 4 years ago

I know that TF 2.x doesn't have tf.contrib module anymore. But it seems like tf.contrib has been removed from preinstalled TF1.15 version in Colab. I'm using object detection models and this module is needed for almost everything there(training, exports, etc.).

Until last Tuesday training and testing with preinstalled TF 1.15 and even TF 2.1 worked perfectly. I tried to uninstall the preinstalled versions of TF and use <1.14 but there were other issues like training stop after first evaluation, numpy issues with int and float64 formats and tons of deprecation warnings.

Traceback (most recent call last): File "object_detection/builders/model_builder_test.py", line 23, in <module> from object_detection.builders import model_builder File "/content/models/research/object_detection/builders/model_builder.py", line 22, in <module> from object_detection.builders import box_predictor_builder File "/content/models/research/object_detection/builders/box_predictor_builder.py", line 20, in <module> from object_detection.predictors import convolutional_box_predictor File "/content/models/research/object_detection/predictors/convolutional_box_predictor.py", line 23, in <module> slim = tf.contrib.slim AttributeError: module 'tensorflow' has no attribute 'contrib'

ashsny commented 4 years ago

this is #1070 - if you're going to mess with PYTHONPATH - prepend, don't overwrite. we're moving to 2.x by default on Friday so 1.15 has been moved to another location on disk and we (colab) are using PYTHONPATH to use it by default (for now)