【问题标题】:Tensor("args_0:0", shape=(28, 28, 1), dtype=float32)张量("args_0:0", shape=(28, 28, 1), dtype=float32)
【发布时间】:2020-02-11 22:06:13
【问题描述】:

出于学习目的,我试图在 Google Colab 中执行以下代码。当我执行以下代码时收到此消息。

张量("args_0:0", shape=(28, 28, 1), dtype=float32)

def normalize(images, labels):
  print(images)

  images = tf.cast(images, tf.float32)
  print(images)

  images /= 255
  print(images)


  return images, labels

我试图理解这条消息的含义,但我无法理解它。尝试在网上搜索,但找不到太多资源。谁能说出这句话是什么意思?

【问题讨论】:

  • 这是print(images) 的结果。 images 是一个Tensor 对象,名称为"args_0:0",形状为(28,28,1),类型为float。
  • 谢谢。我也收到了这个声明。 Tensor("truediv:0", shape=(28, 28, 1), dtype=float32) 这里“truediv:0”是否也指张量的名称?
  • @KulothunganSenthil truediv(真正的除法)是在images /= 255执行的除法操作的名称

标签: tensorflow python-3.6 tensorflow-serving


【解决方案1】:

此输出意味着您的图像是形状为 (28,28,1) 的张量,float32 中的类型 (28,28,1) 中的 1 是 gray-scale 的单个字节,这意味着您有灰度图像(基于您的代码)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-07
    • 2021-03-12
    • 2020-07-08
    相关资源
    最近更新 更多