Tell us what’s happening:
Google Colab seems to be having an issue importing/installing tensorflow_datasets. Without it, completing the SMS challenge is impossible.
For details, this occurs in the main google colab without edited code blocks. Here is the exact error:
TypeError Traceback (most recent call last)
<ipython-input-1-de4264bf5fd5> in <module>
9 from tensorflow import keras
10 get_ipython().system('pip install tensorflow-datasets')
---> 11 import tensorflow_datasets as tfds
12 import numpy as np
13 import matplotlib.pyplot as plt
10 frames
/usr/local/lib/python3.8/dist-packages/google/protobuf/descriptor.py in __new__(cls, name, full_name, index, number, type, cpp_type, label, default_value, message_type, enum_type, containing_type, is_extension, extension_scope, options, serialized_options, has_default_value, containing_oneof, json_name, file, create_key)
559 else:
560 return _message.default_pool.FindFieldByName(full_name)
--> 561
562 def __init__(self, name, full_name, index, number, type, cpp_type, label,
563 default_value, message_type, enum_type, containing_type,
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
1. Downgrade the protobuf package to 3.20.x or lower.
2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
Your code so far
Here are the different ways that I tried to solve this issue:
!pip install -q tfds-nightly tensorflow # tried force installing tensorflow
!pip install --upgrade tensorflow # updated to latest version of tensorflow
!pip install protobuf==4.21.0 # updated protobug
I placed these in the top/first code block, but none of them worked.
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36
Challenge: Machine Learning with Python Projects - Neural Network SMS Text Classifier
Link to the challenge: