2

I'm trying to use optim.minimize from Hyperas. The code is running is google colab, python 3 + GPU.

When I run this:

best_run, best_model = optim.minimize(model=create_model, data=new_data, algo=tpe.suggest,max_evals=100, trials=Trials(), notebook_name='xxxxxx')

This error is thrown:

......

/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 rows x 10 columns] is not a module, class, method, function, traceback, frame, or code object

Any clue of what's wrong?

Thanks!

DaniOnd
  • 21
  • 1

1 Answers1

0

the data of optim.minimize have to be method, I guess you used numpy array as the input of optim.minimize ('new_data')

new_data should be changed to as follows:

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')
Josh Rumbut
  • 2,640
  • 2
  • 32
  • 43