因为pytorch中没有可视化的包,所以在画图的时候使用了tensorboardX。
步骤1:激活安装pytorch框架的环境,查看安装的包,如果有tensorflow,高版本的tf一般自带tensorboardX.没有安装tensorflow,那就pip install tensorflow。
步骤2:pip list 查看tf和tensorboard版本是否一致
步骤3:版本不一致,直接uninstall tensorboard。重新安装,带着tf的版本
pip uninstall tensorboard
pip install tensorboard==2.4.0
步骤4:使用cd +文件目录,打开目标文件
步骤5,打开运行出来的网址,我的是这个http://localhost:6006/#scalars