小编cro*_*ssx的帖子

TensorFlow ValueError:应定义输入的通道尺寸。找不到`

我正在尝试在TensorFlow(此处为PyTorch实现)中实现本白皮书中所述的“扩散残差网络”,以在CityScapes数据集上对其进行训练并将其用于语义图像分割。不幸的是,我在尝试训练时遇到错误,而且似乎找不到解决方法。

由于这种类型的网络可以看作是ResNet的扩展,因此我使用了官方的TensorFlow ResNet模型(Link),并通过更改步幅,添加了膨胀(作为tf.layers.conv2d函数中的参数)来修改了体系结构。连接。

为了训练该网络,我想使用与TensorFlow ResNet模型中相同的方法:将tf.estimator与input_fn结合使用(可以在本文结尾处找到)。

现在,当我想使用CityScapes数据集训练该网络时,出现以下错误:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-19-263240bbee7e> in <module>()
----> 1 main()

<ipython-input-16-b57cd9b52bc7> in main()
     27         print('Starting a training cycle.')
     28         drn_classifier.train(
---> 29             input_fn=lambda: input_fn(True, _BATCH_SIZE, _EPOCHS_PER_EVAL),hooks=[logging_hook])
     30 
     31         print(2)

~\Anaconda3\envs\master-thesis\lib\site-packages\tensorflow\python\estimator\estimator.py in train(self, input_fn, hooks, steps, max_steps, saving_listeners)
    300 
    301     saving_listeners = _check_listeners_type(saving_listeners)
--> 302     loss = self._train_model(input_fn, hooks, saving_listeners)
    303     logging.info('Loss for final step: %s.', loss)
    304     return self

~\Anaconda3\envs\master-thesis\lib\site-packages\tensorflow\python\estimator\estimator.py in _train_model(self, input_fn, …
Run Code Online (Sandbox Code Playgroud)

python machine-learning deep-learning tensorflow resnet

5
推荐指数
2
解决办法
4535
查看次数