我的目標是爲數據增強目的引入隨機縮放和轉換。爲什麼`tf.image.resize_images`設置圖像形狀?
distorted_image = tf.image.resize_images(distorted_image, random_scale, random_scale)
distorted_image = tf.image.crop_to_bounding_box(distorted_image, random_y, random_x, 299, 299)
這種失敗'image' must be fully defined.
交換行工作,但並沒有做什麼,我真正需要的。
distorted_image = tf.image.crop_to_bounding_box(distorted_image, random_y, random_x, 299, 299)
distorted_image = tf.image.resize_images(distorted_image, random_scale, random_scale)
所以好像resize_images失去了像張量的形狀,然後crop_to_bouding_box
失敗。這是故意的,我錯過了什麼?調整大小後random_crop
如何工作,但crop_to_bounding_box
不是?
我結束了內聯'random_crop'並做了小的修改,並且像魅力一樣工作。謝謝! – Clash