AttributeError: module 'tensorflow' has no attribute 'ConfigProto'

前端 未结 5 1863
庸人自扰
庸人自扰 2021-01-01 10:16

I\'m working in Pytorch. I can import tensorflow (version 1.13.1) and need ConfigProto:

import tensorflow as tf
config = tf.ConfigProto(intra_op_parallelism         


        
5条回答
  •  不知归路
    2021-01-01 10:27

    Info:

    RTX 2080
    ubuntu 16.04
    cuda 10.0
    cuDNN v7.4.1.5
    Python V 3.5
    

    pip list:

    tensorflow (1.13.1)
    tensorflow-gpu (1.13.1)
    tf-nightly-gpu (1.14.1.dev20190509)
    

    Code:

    import tensorflow as tf
    from tensorflow import keras
    
    config = tf.ConfigProto()
    config.gpu_options.allow_growth = True
    sess = tf.Session(config=config)
    

    output:

    Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 7439 MB memory) -> physical GPU (device: 0, name: GeForce RTX 2080, pci bus id: 0000:02:00.0, compute capability: 7.5)

    That works for me !

提交回复
热议问题