pip install jupyterlab
jupyter notebook password
jupyter lab --generate-config
可看到当前配置文件路径。## 服务的端口,用默认的8888即可 c.NotebookApp.port = 8888 ## 是否需要自动弹出浏览器,服务器端一般不需要 c.NotebookApp.open_browser = False ## The directory to use for notebooks and kernels. c.NotebookApp.notebook_dir = '/home/ec2-user' ## client ip 限制 c.NotebookApp.ip='*'启动
jupyter-lab &
1 2 3 | import tensorflow as tf print ( "tf.config.list_physical_devices('GPU'):" + str (tf.config.list_physical_devices( 'GPU' ))) print ( "tf.test.is_built_with_cuda():" + str (tf.test.is_built_with_cuda())) |
tf.config.list_physical_devices('GPU'):[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')] tf.test.is_built_with_cuda():True