水玉采色 2022-04-29 14:35 采纳率: 100%
浏览 143
已结题

想要知道在python def plot_images(images, labels, class_names):语句中python起什么作用以及怎样正确使用

问题遇到的现象和发生背景

使用convolution-network-natural-scenes项目代码实现Imagnette数据集的图片分类。

Imagnette是从大型数据集ImageNet(超过1400万张图片, 20,000个类别)中抽取出来的一个小数据集,由于早期研究人员和学生的计算资源有限,但他们也想在ImageNet这样的数据集上做研究和练习,因此才有了imagnette这个袖珍版的数据集。

imagenette的训练集有9469张图片,测试集有3925张图片,格式都为JPEG,图片分辨率不统一,但宽高都不小于160个像素。

问题相关代码,请勿粘贴截图

问题相关代码:
import numpy as np
import matplotlib.pyplot as plt

python
def plot_images(images, labels, class_names):
fig, axes = plt.subplots(3, 5, figsize=(12, 6))

这里plot_images函数抬头为:

def plot_images(images, labels, class_names):
运行结果及报错内容

1:name 'python' is not defined

2:2022-04-29 14:01:38.783991: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
OMP: Error #15: Initializing libiomp5, but found libiomp5md.dll already initialized.

我的解答思路和尝试过的方法

删除python或者定义python,都会引起第2项错误。

我想要达到的结果

知道在这里python的作用,跑通程序。

  • 写回答

1条回答 默认 最新

  • ~白+黑 Python领域新星创作者 2022-04-29 16:25
    关注

    第一按照代码规范,那个python是必须要去掉的
    第二卸载干净,试着重新安装一下tensortflow,对应好python版本

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 6月8日
  • 已采纳回答 5月31日
  • 创建了问题 4月29日

悬赏问题

  • ¥15 在若依框架下实现人脸识别
  • ¥15 网络科学导论,网络控制
  • ¥100 安卓tv程序连接SQLSERVER2008问题
  • ¥15 利用Sentinel-2和Landsat8做一个水库的长时序NDVI的对比,为什么Snetinel-2计算的结果最小值特别小,而Lansat8就很平均
  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同