我正在尝试训练一些东西,并正确获取图像的路径

时间:2018-07-18 17:50:47

标签: python tensorflow

我使用FCRN-DepthPrediction来实现代码。我使用from PyQt5 import QtWidgets, QtGui, QtCore class Window(QtWidgets.QWidget): def __init__(self, parent=None): super(Window, self).__init__(parent) self.vlayout = QtWidgets.QVBoxLayout(self) self.pushButton1 = QtWidgets.QPushButton("Press me") self.pushButton1.clicked.connect(self.addCheckbox) self.pushButton2 = QtWidgets.QPushButton("OK") self.pushButton2.clicked.connect(self.onClicked) self.vlayout.addWidget(self.pushButton1) self.vlayout.addWidget(self.pushButton2) self.checkboxes = [] def addCheckbox(self): checkbox = QtWidgets.QCheckBox() self.checkboxes.append(checkbox) self.vlayout.addWidget(checkbox) def onClicked(self): for i, checkbox in enumerate(self.checkboxes): if checkbox.isChecked(): print("print {} on the screen".format(i)) if __name__ == '__main__': import sys application = QtWidgets.QApplication(sys.argv) window = Window() window.setWindowTitle('Hello') window.resize(250, 180) window.show() sys.exit(application.exec_()) 将所有带标签和拆分的图像转换为png图像。然后,我提供了这些图像的路径。

之后,我运行以下命令:

convert.py

我得到以下输出:

(tensorflow) C:\Users\Grace\Documents\FCRN-DepthPrediction\tensorflow>python predict_nick.py -m train --machine nicolas --gpu 0 -s nyudepth --px all --loss berhu --max_steps 75000 --ldecay --l2norm --remove_sky -t -v

这是错误开始的地方:

[fcrn] Selected Params:

Namespace(batch_size=1, data_aug=False, data_path=' C:\\Users\\Grace\\Documents\\FCRN-DepthPrediction\\tensorflow\\modules\\datasets', dataset='nyudepth', dropout=0.5, full_summary=False, gpu='0', image_path='', l2norm=True, ldecay=True, learning_rate=0.0001, log_directory='log_tb/', loss='berhu', machine='nicolas', max_steps=75000, mode='train', model_name='fcrn', model_path='', output_directory='', px='all', remove_sky=True, show_test_results=False, show_train_progress=True, show_valid_progress=True)

[fcrn] Selected mode: Train
[Dataloader] NyuDepth object created.

[Dataloader] Loading 'data/nyudepth_train.txt'...
time: 0.0 s

Summary - TrainData
image_filenames:  5
depth_filenames:  5

[Dataloader] Loading 'data/nyudepth_test.txt'...
time: 0.0 s

Summary - TestData (Validation Set)
image_filenames:  5
depth_filenames:  5

[Dataloader] dataloader object created.
Debug------------------------ [<tf.Tensor     'input_producer/Gather:0' shape=() dtype=string>, <tf.Tensor 'input_producer/Gather_1:0' shape=() dtype=string>]
tf_image_key:    Tensor("input_producer/Gather:0", shape=(), dtype=string)
tf_depth_key:    Tensor("input_producer/Gather_1:0", shape=(), dtype=string)
tf_image_file:   Tensor("ReadFile:0", shape=(), dtype=string)
tf_depth_file:   Tensor("ReadFile_1:0", shape=(), dtype=string)
tf_image:        Tensor("DecodePng:0", shape=(?, ?, 3), dtype=uint8)
tf_depth:        Tensor("DecodePng_1:0", shape=(?, ?, 1), dtype=uint16)
tf_image_shape:  Tensor("Shape:0", shape=(3,), dtype=int32)
tf_depth_shape:  Tensor("Shape_1:0", shape=(3,), dtype=int32)

[Network/Model] Build Network Model...

[Network/Train] Training Tensors created.
Tensor("model/Input/batch_1:0", shape=(1, 228, 304, 3), dtype=float32)
Tensor("model/Input/batch_1:1", shape=(1, 228, 304, 3), dtype=uint8)
Tensor("model/Input/batch_1:2", shape=(1, 128, 160, 1), dtype=float32)
<tf.Variable 'model/Train/global_step:0' shape=() dtype=int32_ref>
Tensor("model/Train/learning_rate_1:0", shape=(), dtype=float32)

[Network/Validation] Validation Tensors created.
Tensor("model_1/convert_image:0", shape=(?, ?, 3), dtype=float32)
Tensor("model_1/truediv:0", shape=(?, ?, 1), dtype=float32)
Tensor("model_1/Squeeze:0", shape=(228, 304, 3), dtype=float32)
Tensor("model_1/convert_image_1:0", shape=(228, 304, 3), dtype=uint8)
Tensor("model_1/Squeeze_1:0", shape=(128, 160, 1), dtype=float32)

[Network/Loss] Loss: All Pixels
[Network/Loss] Loss Function: BerHu
[Network/Model] Number of trainable parameters: 63572737

Train with approximately 15000 epochs

[Network/Training] Initializing graph's variables...
[Network/Training] Training Initialized!

Tensor("Train/loss:0", shape=(), dtype=string)

0 个答案:

没有答案