ddhendo 2022-02-28 22:08 采纳率: 0%
浏览 874
已结题

AttributeError: Module 'numpy.core' has no attribute 'numerictypes'

import tensorflow as tf
import matplotlib.image as img
import matplotlib.pyplot as plt
sess=tf.InteractiveSession()
image=img.imread(r"C:\Users\origi\Desktop\2\temshow.jpg")
shape=tf.shape(image).eval() # 读取图片的大小
h,w=shape[0],shape[1]
standardization_img=tf.image.per_image_standardization(image) # 图片标准化

fig=plt.figure() # 设置3个画布
fig1=plt.figure()
fig2=plt.figure()

ax=fig.add_subplot(111)
ax.set_title("original image")
ax.imshow(image)

ax2=fig2.add_subplot(111)
ax2.set_title("standardization image")
ax2.imshow(standardization_img.eval())

ax1=fig1.add_subplot(311)
ax1.set_title("original hist")
ax1.hist(sess.run(tf.reshape(image,[h*w,-1]))) # matplotlib.pyplot.figure.hist函数用来画直方图,数据值-出现的频次

ax1=fig1.add_subplot(313)
ax1.set_title("standardization hist")
ax1.hist(sess.run(tf.reshape(standardization_img,[h*w,-1])))

plt.ion()
plt.show()
plt.pause(0)

img

  • 写回答

0条回答 默认 最新

    报告相同问题?

    问题事件

    • 系统已结题 3月8日
    • 创建了问题 2月28日

    悬赏问题

    • ¥15 为啥画版图在Run DRC会出现Connect Error?可我Calibre的hostname和计算机的hostname已经设置成一样的了。
    • ¥20 网站后台使用极速模式非常的卡
    • ¥20 Keil uVision5创建project没反应
    • ¥15 mmseqs内存报错
    • ¥15 vika文档如何与obsidian同步
    • ¥15 华为手机相册里面的照片能够替换成自己想要的照片吗?
    • ¥15 陆空双模式无人机飞控设置
    • ¥15 sentaurus lithography
    • ¥100 求抖音ck号 或者提ck教程
    • ¥15 关于#linux#的问题:子进程1等待子进程A、B退出后退出(语言-c语言)