Closed DavideRutigliano closed 4 years ago
Welcome to Talos community! Thanks so much for creating your first issue :)
Code from "logging.py" where the error is thrown:
`
self._all_keys = list(model_history.history.keys())
self._metric_keys = [k for k in self._all_keys if 'val_' not in k]
self._val_keys = [k for k in self._all_keys if 'val_' in k]
# create a header column for output
_results_header = ['round_epochs'] + self._all_keys + self._param_dict_keys
self.result.append(_results_header)
# save the results
from .results import save_result
save_result(self)
`
When calling save results there's something broken with "self.results":
`def save_result(self): import numpy as np
np.savetxt(self._experiment_log,
self.result,
fmt='%s',
delimiter=',')
` My ValueError is thrown at -> 1330 X = np.asarray(X) of np.savetxt, where X is self.result in the calling method.
It might be because of your parameter dictionary. Try this so that each value is different parameter instead of being a tuple:
'input_shape' : [(3, 224, 224)],
This will definitely likely not work:
weights' : [[2., 1., 1., 1., 1., 1.]],
Hi All,
I'm using talos for hyperparameter optimization and everything was working fine. Now i get an error (probably regarding the model or the history). Here the full output:
` 0%| | 0/16 [00:00<?, ?it/s]{'weights': [2.0, 1.0, 1.0, 1.0, 1.0, 1.0], 'dropout_ratio': 0.25, 'batch_size': 5, 'optimizer': 'adam', 'init_p': 0.01, 'ratio': 1, 'dense_layer_size': 32, 'input_shape': (3, 224, 224), 'lr': 0.0001, 'epochs': 3, 'base_model': 'resnet50', 'gamma': 0.5, 'alpha': 3} Epoch 1/3 Epoch 1/3
Epoch 00001: val_f1_score improved from -inf to 0.68685, saving model to model_2_weights.h5 1/1 [==============================] - 4s 4s/step - loss: 0.0427 - log_loss: 0.0088 - accuracy: 0.2000 - f1_score: 0.9582 - val_loss: 1.4823 - val_log_loss: 0.3988 - val_accuracy: 0.0000e+00 - val_f1_score: 0.6869 Epoch 2/3
Epoch 00002: val_f1_score improved from 0.68685 to 0.68702, saving model to model_2_weights.h5 1/1 [==============================] - 2s 2s/step - loss: 0.0386 - log_loss: 0.0079 - accuracy: 0.0000e+00 - f1_score: 0.9621 - val_loss: 1.4839 - val_log_loss: 0.3993 - val_accuracy: 0.0000e+00 - val_f1_score: 0.6870 Epoch 3/3
Epoch 00003: val_f1_score improved from 0.68702 to 0.68718, saving model to model_2_weights.h5 1/1 [==============================] - 2s 2s/step - loss: 0.0424 - log_loss: 0.0087 - accuracy: 0.0000e+00 - f1_score: 0.9586 - val_loss: 1.4838 - val_log_loss: 0.3993 - val_accuracy: 0.0000e+00 - val_f1_score: 0.6872
ValueError Traceback (most recent call last)