I am using the hyperparameter optimization package spearmint.
In the code, I am using an keras (backend=tensorflow) based jobs. The code seems to work well when CPU is used.
However, when tensorflow uses GPU, the code terminates with the following error: Problem running the job:
(<type 'exceptions.AttributeError'>, AttributeError("'google.protobuf.pyext._message.RepeatedScalarConta' object has no attribute '_values'",), <traceback object at 0x7fcb23ea1bd8>)
Traceback (most recent call last):
File "/home/sujk/myLib/spearmint/spearmint/spearmint/runner.py", line 41, in job_runner
elif job.language == PYTHON: run_python_job(job)
File "/home/sujk/myLib/spearmint/spearmint/spearmint/runner.py", line 116, in run_python_job
dbl_vals = param.dbl_val._values
AttributeError: 'google.protobuf.pyext._message.RepeatedScalarConta' object has no attribute '_values'
None
Following is the code for the job for reproducibility of the error:
import numpy as np
import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPooling2D
from keras import backend as K
def main(job_id, params):
return np.random.uniform(0, 1)
if __name__ == "__main__":
res = main(None, None)
print(res)
Following is the code for config.pb file:
language: PYTHON
name: "test"
variable {
name: "k_size"
type: INT
size: 1
min: 2
max: 4
}
The above was compiled using the following command:
spearmint config_mnist.pb --driver=local --method=GPEIOptChooser --method-args=noiseless=0 --max-concurrent=1 --grid-size=1