Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2

前端 未结 8 1721
难免孤独
难免孤独 2020-11-22 04:46

I am new to TensorFlow. I have recently installed it (Windows CPU version) and received the following message:

Successfully installed tensorflow-1.4

8条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-22 05:09

    The easiest way that I found to fix this is to uninstall everything then install a specific version of tensorflow-gpu:

    1. uninstall tensorflow:
        pip uninstall tensorflow
    
    1. uninstall tensorflow-gpu: (make sure to run this even if you are not sure if you installed it)
        pip uninstall tensorflow-gpu
    
    1. Install specific tensorflow-gpu version:
        pip install tensorflow-gpu==2.0.0
        pip install tensorflow_hub
        pip install tensorflow_datasets
    

    You can check if this worked by adding the following code into a python file:

    from __future__ import absolute_import, division, print_function, unicode_literals
    
    import numpy as np
    
    import tensorflow as tf
    import tensorflow_hub as hub
    import tensorflow_datasets as tfds
    
    print("Version: ", tf.__version__)
    print("Eager mode: ", tf.executing_eagerly())
    print("Hub Version: ", hub.__version__)
    print("GPU is", "available" if tf.config.experimental.list_physical_devices("GPU") else "NOT AVAILABLE")
    

    Run the file and then the output should be something like this:

    Version:  2.0.0
    Eager mode:  True
    Hub Version:  0.7.0
    GPU is available
    

    Hope this helps

提交回复
热议问题