python - Metal 火车出现意外的关键字参数 'n_epochs'

标签 python machine-learning metal

我正在编写 Python 代码,在这部分代码中,我想使用 Metal 来训练我的模型,如下所示:

from metal.label_model import LabelModel
gen_model = LabelModel()
%time gen_model.train(L_train[0], n_epochs=500, print_every=100)

但是这给出了:

TypeError                                 
Traceback (most recent call last)
<timed eval> in <module>

TypeError: train() got an unexpected keyword argument 'n_epochs'

最佳答案

0.3.0 中有一个变化:

'Renames Classifier.train to Classifier.train_model to avoid overwriting the nn.Module.train function'

因此,请尝试使用 train_model() 而不是 train():

from metal.label_model import LabelModel
gen_model = LabelModel()
%time gen_model.train_model(L_train[0], n_epochs=500, print_every=100)

来源:

https://github.com/HazyResearch/metal/commit/4210c7c66f3f4a6fc7287192aec133c293ed8198

关于python - Metal 火车出现意外的关键字参数 'n_epochs',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52963958/

相关文章:

machine-learning - 使用 _max_pool_gradient 的 Tensorflow 反池化操作

ios - newBufferWithBytes() 有大小限制吗?

metal - 对 Metal 中 mipmap 的生成感到困惑?

python - 使用 groupby 列根据最小和最大列值计算 Pandas Dataframe 的变化率

python - 训练两个特征而不是一个

Python请求隐藏url中传递的参数

azure - 使用 Azure 机器学习预测所选的抵押贷款类型

ios - Metal 色附件支持的像素格式

python c 扩展/opencl 守护进程

Python 检查日期是否为 future 30 天