application_vnd.jupyter.stderr_output_2.png text_plain_output_3.png text_plain_output_1.png
from IPython.display import clear_output
!pip install -q tensorflow==2.4.1
clear_output()
import tensorflow as tf
gpus = tf.config.list_physical_devices("GPU")
if gpus:
    tf.config.experimental.set_memory_growth(gpus[0], True)  #设置GPU显存用量按需使用
    tf.config.set_visible_devices([gpus[0]],"GPU")