Run worker inside pytest when running integration tests
justin1121 opened this issue · comments
It would be ideal if we could run the worker automatically inside pytest when running integration tests. Currently this error occurs:
self.run()
File "/anaconda3/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/Users/justinpatriquin/projects/Grid/grid/workers/base_worker.py", line 158, in listen_to_channel_impl
out = handle_message(message)
File "/Users/justinpatriquin/projects/Grid/grid/services/fit_worker.py", line 33, in fit_worker
return self.fit_keras(decoded)
File "/Users/justinpatriquin/projects/Grid/grid/services/fit_worker.py", line 50, in fit_keras
model = keras_utils.ipfs2keras(self.api, decoded['model_addr'])
File "/Users/justinpatriquin/projects/Grid/grid/lib/keras_utils.py", line 15, in ipfs2keras
return deserialize_keras_model(api.cat(model_addr))
File "/Users/justinpatriquin/projects/Grid/grid/lib/keras_utils.py", line 34, in deserialize_keras_model
model = keras.models.load_model('temp_model2.h5')
File "/anaconda3/lib/python3.6/site-packages/keras/models.py", line 246, in load_model
topology.load_weights_from_hdf5_group(f['model_weights'], model.layers)
File "/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 3382, in load_weights_from_hdf5_group
K.batch_set_value(weight_value_tuples)
File "/anaconda3/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2373, in batch_set_value
get_session().run(assign_ops, feed_dict=feed_dict)
File "/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 905, in run
run_metadata_ptr)
File "/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1083, in _run
'Cannot interpret feed_dict key as Tensor: ' + e.args[0])
TypeError: Cannot interpret feed_dict key as Tensor: Tensor Tensor("Placeholder:0", shape=(2, 8), dtype=float32) is not an element of this graph.```