WARNING: All log messages before absl::InitializeLog() is called are written to STDERR

I0000 00:00:1791713427.005373 8200 port.cc:153] oneDNN custom operations are on. You may see slightly different nu
merical results due to floating-point round-off errors from different computation orders. To turn them off, set the e
nvironment variable TF_ENABLE_ONEDNN_OPTS=0.

根据以上指示增加代码

import os
os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0'
import tensorflow as tf

1.安装tensorflow
pip install tf-nightly
2.安装matplotlib
pip install matplotlib
3.屏蔽错误
引入os,屏蔽代码如下

import os
os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0'
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
print(tf.__version__)

Hosts文件添加以下代码

20.205.243.166 github.com
199.232.69.194 github.global.ssl.fastly.net

# Windows路径

C:\Windows\System32\drivers\etc\hosts

# Mac/Linux路径

/etc/hosts

添加后清理DNS缓存

# Windows
ipconfig /flushdns

# MacOS
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

# Linux
sudo systemd-resolve --flush-caches