Machine Learning with Python Projects - Neural Network SMS Text Classifier

Tell us what’s happening:

Im trying to run the set up block and it has issue with this line:

import tensorflow_datasets as tfds

it gives this error:
TypeError: Descriptors cannot not be created directly.
If this call came from a 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).

I have tried downgrading protobuf as it suggests but that doesnt help

Your code so far

import libraries


%tensorflow_version only exists in Colab.

!pip install tf-nightly

except Exception:


import tensorflow as tf

import pandas as pd

from tensorflow import keras

!pip install tensorflow-datasets

import tensorflow_datasets as tfds

import numpy as np

import matplotlib.pyplot as plt


(This is just what is provided)

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0

Challenge: Machine Learning with Python Projects - Neural Network SMS Text Classifier

Link to the challenge:

I remember this issue… I’ll try to find the post, but I believe its because there is a line in the imports that is upgrading your code to the latest version with isn’t compatible… Ah found it…

Below is the thread… I believe the issue was an import of tf_nightly… which downloads the most up to date version… which isn’t compatible or something. I just commented that out, and everything else worked fine.

That seemed to have worked! Thank you so much!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.