我正在尝试使用来自Hyperas的。正在运行的代码是google,python 3+ GPU。
当我运行这个:
best_run, best_model = optim.minimize(model=create_model, data=new_data, algo=tpe.suggest,max_evals=100, trials=Trials(), notebook_name='xxxxxx')引发此错误:
.
/usr/lib/python3.6/inspect.py in getfile(object)
664 return object.co_filename
665 raise TypeError('{!r} is not a module, class, method, '
--> 666 'function, traceback, frame, or code object'.format(object))TypeError:
6743行x 10列不是模块、类、方法、函数、追溯、框架或代码对象。
知道出什么事了吗?
谢谢!
发布于 2021-03-10 02:39:47
optim.minimize的数据必须是方法,我猜您使用numpy数组作为optim.minimize ('new_data')的输入。
new_data应改为:
def new_data() :
return x_train, y_train, x_test, y_test
best_run, best_model = optim.minimize(model=create_model, data=new_data, algo=tpe.suggest,max_evals=100, trials=Trials(), notebook_name='xxxxxx')https://stackoverflow.com/questions/59760900
复制相似问题