Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

module 'tensorflow' has no attribute 'GPUOptions'

Tags:

tensorflow

gpu

I'm using dell laptop with GTX 960M, and i installed tensorflow 2.0 alpha. i used to use 1.5 version and it work with tf.GPUOptions, but in this version, this causes an error: AttributeError: module 'tensorflow' has no attribute 'GPUOptions' someone help me if i do the thing wrong with this version

Traceback (most recent call last): File "prepare_training.py", line 20, in gpu_option = tf.GPUOptions(per_process_gpu_memory_fraction=0.333) AttributeError: module 'tensorflow' has no attribute 'GPUOptions'

like image 571
An Lưu Công Avatar asked Apr 30 '19 08:04

An Lưu Công


Video Answer


1 Answers

Tensorflow 2.x has undergone major changes from 1.x.

As per official communication,

tf.contrib will be removed from the core TensorFlow repository and build process. TensorFlow’s contrib module has grown beyond what can be maintained and supported in a single repository. Larger projects are better maintained separately, while smaller extensions will graduate to the core TensorFlow code. A special interest group (SIG) has been formed to maintain and further develop some of the more important contrib projects going forward. Please engage with this RFC if you are interested in contributing.

If you want to use the tensorflow 1.x functions/methods, there is a compatibility module kept in tensorflow 2.x.

tf.compat.v1.GPUOptions(per_process_gpu_memory_fraction=0.333)
like image 67
Rohit Avatar answered Sep 19 '22 07:09

Rohit