Where is tf.distributions in tensorflow 2.0? - tensorflow2.0

https://www.tensorflow.org/api_docs/python/tf/distributions/Distribution
There is no doc on this?
I see the doc on contrib but nothing about this.

It has been moved into Tensorflow Probability (TFP):
pip install --upgrade tensorflow-probability

Related

Difficulty updating keras/tensorflow on mac

I am working on a jupyter notebook script which I used last year to train a neural network.
When I try to import the keras tokenizer:
from keras.preprocessing.text import Tokenizer
I receive this error
I have seen other posts which suggest that I need to update tensorflow. My anaconda environment tells me I have 1.13.1 installed. But when I try to update tensorflow-base to 1.15 in the anaconda navigator, I receive this error:
I can update tensorflow from my command line using:
conda install tensorflow=1.15.0
But this doesn't update tensorflow in my anaconda environment and the error persists in my notebook.
Any help would be much appreciated! As you can probably tell, I am a novice python user.
The error says some packages needed to update Tensorflow/Andaconda requires Python 3.11 or newer. Since not all of the error log can be seen however, I would upgrade to python 3.7 to be safe. You can download this from the official page: https://www.python.org/downloads/
If the problem persists, try using pip to update the packages(In bash) :
pip install tensorflow
pip install conda
If you get an error while using pip, try:
pip3 install tensorflow
pip3 install conda
This same method can be used to update keras:
pip install keras
or if that does not work:
pip3 install keras
If pip is not recognized at a command, Python 3.7 is not added to path. I do not have experience with macOS, but this article should go into enough depth.
https://realpython.com/add-python-to-path/#how-to-add-python-to-path-on-linux-and-macos

AttributeError: module 'tensorflow._api.v1.config' has no attribute 'set_visible_devices'

First of all, I apologize that my English is not good for you to understand.
Currently, I am doing computer vision using tensorflow version 1.14. In the process, the following problem ocurred in the process of rotating the model using GPU.
AttributeError: module 'tensorflow._api.v1.config' has no attribute 'set_visible_devices'
The current development environment is as follows.
Python: 3.7.9
conda: 4.8.3
tensorflow: 1.14.0
keras: 2.3.1
In addition, I currently have 4 gpu, and i want to use 2 gpu as if it were 1 gpu. Can you give me a good idea for this?
thank you.
It seems you need to upgrade the tensorflow because tf.config.set_visible_devices() function is available in latest version of tensorflow, you can use below code to upgrade the tensorflow:
!pip install --upgrade pip.
!pip install --upgrade tensorflow
You can follow the link to install the CPU/GPU version of tensorflow as per requirement and for tf.config.set_visible_devices() function related details, check here

Compatibility issues between keras and tensorflow

I want to ask about compatibility issues between keras and tensorflow.
Specifically, how can I find the latest compatible version of keras and tensorflow? I found a lot of places including the official website of keras and did not find how to find the tensorflow version compatible with the latest keras2.24.
My current version of tensorflow+keras is 1.4.0+2.1.0, which does not support some new features.
If you don't care about having the latest Keras version, you can use the tf.Keras module that is already available with your Tensorflow installation. Check here
As per the doc:
tf.keras can run any Keras-compatible code, but keep in mind:
The tf.keras version in the latest TensorFlow release might not be the
same as the latest keras version from PyPI. Check tf.keras.version.
When saving a model's weights, tf.keras defaults to the checkpoint
format. Pass save_format='h5' to use HDF5.
I have tensorflow 1.12.0 with keras 2.2.4. I got this by downloading the latest (Anaconda3-2018.12-Windows-x86_64.exe) anaconda which has conda 4.6.4 and python 3.6.8.
I believe I then did a conda update conda and a conda update anaconda.
I then did a conda install tensorflow and a conda install keras.
Activate your environment and update your anaconda version using
conda update anaconda
Next uninstall tensorflow and keras as below
pip uninstall keras
pip uninstall tensorflow
Install Keras and tensorflow again
pip install tensorflow
pip install keras
check the version is updated.If it is not possible comment below.

Tensorflow has no attribute 'svd'

The documentation indicate that tensorflow has a svd operator.
However, I can't find it in my tensorflow with pip for python2.7
I used these command on Mac:
pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0-py2-none-any.whl
Any suggestion would be appreciated.
You are trying to install tensorflow 0.8. The SVD was introduced in tensorflow 0.10. Try installing a more recent version. (Current version is 1.2).

tensorflow installation issue using anaconda

I am trying to install tensorflow using anaconda but followed the following approach and failed.
C:\>activate tensorflow
(tensorflow) C:\>conda create -n tensorflow
CondaValueError: Value error: prefix already exists: C:\Users\pirates\Anaconda3\
envs\tensorflow
(tensorflow) C:\>pip install --ignore-installed --upgrade https://storage.google
apis.com/tensorflow/windows/cpu/tensorflow-1.1.0-cp35-cp35m-win_amd64.whl
tensorflow-1.1.0-cp35-cp35m-win_amd64.whl is not a supported wheel on this platf
orm.
(tensorflow) C:\>
I am not able to install tensorflow with conda command .. what do I do?
I had installed anaconda 1.5 for python 3.6.0
Please somebody help with this. Thanks in advance.
It sounds to my as a python version incompatibility ,try to install python 3.5 and then run tensorflow installation again.