我有一组大小为200x600(WxH)的图像,但当我使用pyplot显示它时,它们的大小看起来像是600x200
train_ds = tf.keras.preprocessing.image_dataset_from_directory(
data_dir,
validation_split=0.2,
subset="training",
seed=123,
image_size=(200, 600),
batch_size=batch_size)
我不知道为什么会这样。当我将其更改为image_size=(600200)时,它看起来不错,但tensorflowjs对形状表示不满
let tensorImg = tf.browser.fromPixels(canvas).resizeNearestNeighbor([200, 600]).toFloat().expandDims();
有什么提示吗
我用自己的数据集测试了它的工作情况。 下面的示例代码
输出:
相关问题 更多 >
编程相关推荐