ObjectDetecionAPI TypeError: __new__() got an unexpected keyword argument 'serialized_options' - tensorflow

I did everything it says at https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md and lastly updated my protoc. When i enter $ protoc --version, it throws libprotoc 3.5.1 on the terminal. But when i try to do $ python object_detection/builders/model_builder_test.py, it throws an error TypeError: _ new _() got an unexpected keyword argument 'serialized_options'. What am i doing wrong?

Updating protobuf to 3.6 works for me.
pip install -U protobuf

Based on this thread in the TensorFlow repository, you should downgrade your protobuf to 3.4.0.

Updating protobuf to 3.8 works for me.
pip install -U protobuf

On python3, none of the above solution worked. So I uninstalled the existing installation using pip. Then installed again by pip3 install protobuf. Then it worked.

Related

BigQuery error: AttributeError: 'ClientOptions' object has no attribute 'api_audience'

I keep receiving this error AttributeError: 'ClientOptions' object has no attribute 'api_audience' once I call the to_dataframe() on the query result from BigQuery. This worked fine before using the same virtual env and not sure what's happening now.
query.result() didn't raise errors but query.to_dataframe() raised the error.
These are the packages I have:
google-cloud==0.34.0
google-cloud-bigquery==2.34.3
google-cloud-bigquery-storage==2.16.2
google-cloud-core==2.3.2
google-cloud-storage==2.7.0
I was able to replicate your error and this is when I downgraded my google-api-core package to 2.7.3.
This can be resolved by upgrading your google-api-core to 2.8.0 and up. But the BEST PRACTICE is to always keep your packages to the latest version. You may upgrade your package to latest version by running below command.
pip install google-api-core --upgrade
the error may be related to version incompatibility between the google-cloud-core package and other Google Cloud packages.
there are two ways to solve that error
pip install --upgrade google-cloud-core
and the other one is a
pip install google-cloud-bigquery==2.29.0

OSError: libcudart.so.10.2: cannot open shared object file: No such file or directory

For some reason, I am getting this error on Colab, even if I don't use GPU... Any help would be greatly appreciated! Thanks! The error message is as following:
OSError: libcudart.so.10.2: cannot open shared object file: No such file or directory
The reason is a mismatch of CUDA versions. I ran into this issue because the preinstalled version of pytorch did match the default version which I installed using %pip install torchaudio (CUDA 10.2). print(torch.__version__) gives 1.10.0+cu111 (CUDA 11.1).
So I reinstalled pytorch, torchaudio and torch vision with the command stated on the pytorch website
%pip install torch==1.10.0+cu113 torchvision==0.11.1+cu113 torchaudio==0.10.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html
After restarting the environment, it should work.
This method uninstalls pytorch and reinstalls another version, it would be faster to just install the matching version of pytorch, in my case:
%pip install -q torchaudio==0.10.0+cu111 -f https://download.pytorch.org/whl/cu111/torch_stable.html
I don't know if it would be better to install the cu113 variant.
Also, I would suggest to check the error logs to find out the python package that causes the error. In my case, it was generated in torch-cluster and it simply resolved by downgrading torch-cluster to 1.5.9 (recent version is 1.6.0 which is release just couple of weeks back and was installed by default)
I've solved it by replacing the version of torchaudio installed by pip with the one from conda.
pip uninstall torchaudio
conda install torchaudio -c pytorch
Notice the message of conda, it installs the version with bundled CUDA lib:
The following NEW packages will be INSTALLED:
torchaudio pytorch/linux-64::torchaudio-0.11.0-py38_cu113

How to solve "ERROR: No matching distribution found for tensorflow==1.12.0"

I am trying to install tensorflow 1.12.0. This is the command that I am using pip install tensorflow==1.12.0. I got this command from this link. This is the error that I am getting.
ERROR: Could not find a version that satisfies the requirement
tensorflow==1.12.0 (from versions: 2.5.0rc0, 2.5.0rc1, 2.5.0rc2,
2.5.0rc3, 2.5.0) ERROR: No matching distribution found for tensorflow==1.12.0
What am I doing wrong?
You can install previous versions of Tensorflow directly from the Github release page. For example, the 1.12.0 version can be downloaded from https://github.com/tensorflow/tensorflow/releases/tag/v1.12.0.
My python version was 3.9. Intalling python version 3.6 solved the problem. I installed it in virtual environment with conda.

I can't install tensorflow2.0

I wanna install tensorflow2.0, but it just failed.
According to error, it said, zsh: 2.0.0-beta1 not found.
pip install tensorflow==2.0.0-beta1
zsh: 2.0.0-beta1 not found.
Remove the hypen -
pip install tensorflow==2.0.0beta1
First,Download tensorflow package ,this is the version of tensorflow about 2.1rc in Windows,you can download by url(https://files.pythonhosted.org/packages/e3/44/a88475dc6905a9816227bff0f31355f7072efa119faff336aa18b27a3347/tensorflow-2.1.0rc2-cp36-cp36m-win_amd64.whl), other version and platform(https://pypi.org/project/tensorflow/2.1.0rc2/#files), finally,you can use pip command to install(pip install tensorflow****).

TensorFlow pip installation issue: cannot import name 'descriptor'

I'm seeing the following error when installing TensorFlow:
ImportError: Traceback (most recent call last):
File ".../graph_pb2.py", line 6, in
from google.protobuf import descriptor as _descriptor
ImportError: cannot import name 'descriptor'
This error signals a mismatch between protobuf and TensorFlow versions.
Take the following steps to fix this error:
Uninstall TensorFlow.
Uninstall protobuf (if protobuf is installed).
Reinstall TensorFlow, which will also install the correct protobuf dependency.
I faced the similar issue, after trial and error, I used the below logic to run the program:
pip install --upgrade --no-deps --force-reinstall tensorflow
This will make sure to uninstall and reinstall the program from fresh. It works!
I would be extra careful before uninstalling/reinstalling other packages such as protobuf. What I think would most likely be the issue is difference in versions. As of writing this, the most recent release of python is 3.7 while tensorflow is only compatible up to 3.6.
If you're using a 3rd party distribution like Anaconda, this can get hidden from you. In this case I would recommend creating a new environment in Anaconda, with python 3.6 and then installing tensorflow: https://conda.io/projects/conda/en/latest/user-guide/getting-started.html#managing-python
Try this:
pip uninstall protobuf
brew install protobuf
mkdir -p
/Users/alexeibendebury/Library/Python/2.7/lib/python/site-packages
echo 'import site;
site.addsitedir("/usr/local/lib/python2.7/site-packages")' >>
/Users/alexeibendebury/Library/Python/2.7/lib/python/site-packages/homebrew.pth