Accessing model after training with hyper-parameter search
I’m trying to do a hyper-parameter search using the huggingface Trainer and ray[tune].I’m more specifically followingthis example from RAY.However, when I try to use the trainer (after all of the code from the example is executed) to predict I get the following error:(Pdb) trainer.predict(train_dataset)
*** AttributeError: 'NoneType' object has no attribute 'forward'Am I supposed to retrain the trainer after a hyper-parameter search?Here is the exact steps I took for clarification:Downloaded example file i.e.pbt_transformers.pyAdded aimport pdb; pdb.set_trace()on line 147 (after the last call in the function)Ran this withpython pbt_transformers.py --smoke-testOnce the debugger started I enteredtrainer.predict(train_dataset)I apologize if the answer is somewhere but I looked at these examples (below) and didn’t see anything that is done after callingtrainer.hyperparameter_search:huggingface.coHyperparameter Search with Transformers and Ray TuneWe’re on a journey to advance and democratize artificial intelligence through open source and open science.
2022-07-07T12:59:17Z
Currently, you have to retrain your model with the best set of hyperparameters to use it afterwards, unless you can find its checkpoint in the runs saved.
2022-07-07T16:43:15Z
Ok great, thank you!