【TensorFlow】安装与自测

  1. 安装TensorFlow

    conda search tensorflow-gpu
    conda install tensorflow-gpu
    
  2. 测试TensorFlow是否安装成功

    python -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
    

    tensorflow 1.0版本的代码要创建会话Session
    需要注意的是:tensorflow的代码默认会占用所有显卡的所有显存

  3. TensorFlow按需分配显存
    参考链接:tensorflow 使用 cpu 而不使用 gpu 问题 - 万道一 - 博客园 (cnblogs.com)

  4. [Update] Tensorflow安装

posted @ 2021-07-22 12:20  达可奈特  阅读(41)  评论(0编辑  收藏  举报