简体   繁体   English

如何修复 <module> 我的神经网络出错了吗?

[英]How to fix in <module> Error for my neural network?

I get the following error File "C:/Users/xx/Desktop/xxx/ost.py", line 213, in main(), while trying to initiate training of neural network 我在main()中获得以下错误文件“C:/Users/xx/Desktop/xxx/ost.py”,第213行,同时尝试启动神经网络的训练

This is for a final lab assignment about pictures classification 这是关于图片分类的最终实验室作业

if __name__ == '__main__':
     main() 

and the main function is 而主要功能是

def main():
    with open('train.pkl', 'rb') as f:
        data = pickle.load(f)

    x = data[0]
    y = data[1]

    # x=feature_extraction_hog(x)

    D = x.shape[1]

    hidden_size = 55
    output_size = 36

    w1 = np.random.uniform(low=-0.1, high=0.1, size=(hidden_size, (D + 1)))
    w2 = np.random.uniform(low=-0.1, high=0.1, size=(output_size, (hidden_size + 1)))

    w1, w2 = fit(x, y, True, output_size, hidden_size, w1, w2, 0.2, 0.2)

    np.savetxt('weights1.txt', w1)
    np.savetxt('weights2.txt', w2)

    y_train_pred = predict(x, w1, w2)

    print(classification_error(y_train_pred, y))

I managed to fix it, the problem was with a line that received too many indexes! 我设法修复它,问题是一条线接收了太多的索引! Thanks anyways 不管怎么说,多谢拉

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何解决Elman神经网络中的过拟合问题? - How to fix overfitting in Elman neural network? 如何在Keras实施的卷积神经网络的训练过程中修复我的骰子损失计算? - How can I fix my dice loss calculation during the training process of a convolutional neural network implemented in Keras? 试图修复神经网络的构造(错误信息:负维度?) - Trying to fix the construction of a neural network (error message: negative dimension?) 如何将我的训练数据输入到该神经网络 - How to Input my Training Data into this Neural Network 使用Keras,当我将Tensorboard回调添加到我的神经网络时,准确性降低了。 我该如何解决? - Using Keras, when I add a Tensorboard callback to my neural network, the accuracy decreases. How do I fix this? 实施人工神经网络时,如何减少训练值中的误差? - How can I reduce the error in my trained values while implementing Artificial Neural Network? 我如何知道我的神经网络是否使用 Mean_Square_Error (Keras) 运行良好 - How can I know if my Neural Network is doing good or not using Mean_Square_Error (Keras) 在OpenCV中运行神经网络时,如何解决“错误:(-215)pbBlob.raw_data_type()== caffe :: FLOAT16在函数blobFromProto中的问题” - How to fix, “error: (-215) pbBlob.raw_data_type() == caffe::FLOAT16 in function blobFromProto” when running neural network in OpenCV 我的神经网络完全连接内核初始化时出错 - Error on my neural network fully connected kernel initialisation 为什么我的递归神经网络给我一个错误? - Why is my recurrent neural network giving me an error?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM