TFLearn Alexnet定制到一定数量类
TFLearn Alexnet customized to a certain number of classes
我正在使用 Alexnet example given in TFLearn to train on my own dataset of images, which is the GroZi-120 database,所以我需要稍微更改它以输出 120 类。
我对 convnets 和深度学习一般不是很熟悉,所以我不确定如何修改代码以正确输出对应于 120 类 的分数。
我尝试将 softmax 行更改为:
network = fully_connected(network, 120, activation='softmax')
但这给了我错误
ValueError: Cannot feed value of shape (64, 17) for Tensor u'TargetsData/Y:0', which has shape '(?, 120)'
有人可以向我解释 this/help 我想知道如何进行吗?
提前致谢!
行中:
model.fit(X, Y, n_epoch=1000, validation_set=0.1, shuffle=True,
show_metric=True, batch_size=64, snapshot_step=200,
snapshot_epoch=False, run_id='alexnet_oxflowers17')
您似乎仍然将形状 [batch_size, 17]
的前一个 Y
馈入网络。
您需要将 X
和 Y
替换为您自己的。
我正在使用 Alexnet example given in TFLearn to train on my own dataset of images, which is the GroZi-120 database,所以我需要稍微更改它以输出 120 类。
我对 convnets 和深度学习一般不是很熟悉,所以我不确定如何修改代码以正确输出对应于 120 类 的分数。
我尝试将 softmax 行更改为:
network = fully_connected(network, 120, activation='softmax')
但这给了我错误
ValueError: Cannot feed value of shape (64, 17) for Tensor u'TargetsData/Y:0', which has shape '(?, 120)'
有人可以向我解释 this/help 我想知道如何进行吗? 提前致谢!
行中:
model.fit(X, Y, n_epoch=1000, validation_set=0.1, shuffle=True,
show_metric=True, batch_size=64, snapshot_step=200,
snapshot_epoch=False, run_id='alexnet_oxflowers17')
您似乎仍然将形状 [batch_size, 17]
的前一个 Y
馈入网络。
您需要将 X
和 Y
替换为您自己的。