Initializing Network... Loading model from .\DANNCE\train_results\MAX\weights.1185-0.00001.hdf5 Traceback (most recent call last): File "E:\anaconda\envs\danncetest\Scripts\dannce-predict-script.py", line 33, in <module> sys.exit(load_entry_point('dannce', 'console_scripts', 'dannce-predict')()) File "f:\test_dannce\dannce\dannce\cli.py", line 54, in dannce_predict_cli dannce_predict(params) File "f:\test_dannce\dannce\dannce\interface.py", line 1534, in dannce_predict "centered_euclidean_distance_3D": losses.centered_euclidean_distance_3D, File "E:\anaconda\envs\danncetest\lib\site-packages\tensorflow\python\keras\saving\save.py", line 182, in load_model return hdf5_format.load_model_from_hdf5(filepath, custom_objects, compile) File "E:\anaconda\envs\danncetest\lib\site-packages\tensorflow\python\keras\saving\hdf5_format.py", line 194, in load_model_from_hdf5 training_config, custom_objects)) File "E:\anaconda\envs\danncetest\lib\site-packages\tensorflow\python\training\tracking\base.py", line 457, in _method_wrapper result = method(self, *args, **kwargs) File "E:\anaconda\envs\danncetest\lib\site-packages\tensorflow\python\keras\engine\training_v1.py", line 451, in compile masks=self._prepare_output_masks()) File "E:\anaconda\envs\danncetest\lib\site-packages\tensorflow\python\keras\engine\training_v1.py", line 1955, in _handle_metrics target, output, output_mask)) File "E:\anaconda\envs\danncetest\lib\site-packages\tensorflow\python\keras\engine\training_v1.py", line 1904, in _handle_per_output_metrics with K.name_scope(metric_name): File "E:\anaconda\envs\danncetest\lib\site-packages\tensorflow\python\keras\backend.py", line 912, in name_scope return ops.name_scope_v2(name) File "E:\anaconda\envs\danncetest\lib\site-packages\tensorflow\python\framework\ops.py", line 6593, in __init__ raise ValueError("name for name_scope must be a string.") ValueError: name for name_scope must be a string.
So i put a pdb in 'File "f:\test_dannce\dannce\dannce\interface.py", line 1534, in dannce_predict;
(Pdb) from tensorflow.keras.models import load_model
Hi @yuan0821, can you tell us a bit more about what led to this? What branch are you using? If it was working for you before, what did you change recently?
Initializing Network... Loading model from .\DANNCE\train_results\MAX\weights.1185-0.00001.hdf5 Traceback (most recent call last): File "E:\anaconda\envs\danncetest\Scripts\dannce-predict-script.py", line 33, in <module> sys.exit(load_entry_point('dannce', 'console_scripts', 'dannce-predict')()) File "f:\test_dannce\dannce\dannce\cli.py", line 54, in dannce_predict_cli dannce_predict(params) File "f:\test_dannce\dannce\dannce\interface.py", line 1534, in dannce_predict "centered_euclidean_distance_3D": losses.centered_euclidean_distance_3D, File "E:\anaconda\envs\danncetest\lib\site-packages\tensorflow\python\keras\saving\save.py", line 182, in load_model return hdf5_format.load_model_from_hdf5(filepath, custom_objects, compile) File "E:\anaconda\envs\danncetest\lib\site-packages\tensorflow\python\keras\saving\hdf5_format.py", line 194, in load_model_from_hdf5 training_config, custom_objects)) File "E:\anaconda\envs\danncetest\lib\site-packages\tensorflow\python\training\tracking\base.py", line 457, in _method_wrapper result = method(self, *args, **kwargs) File "E:\anaconda\envs\danncetest\lib\site-packages\tensorflow\python\keras\engine\training_v1.py", line 451, in compile masks=self._prepare_output_masks()) File "E:\anaconda\envs\danncetest\lib\site-packages\tensorflow\python\keras\engine\training_v1.py", line 1955, in _handle_metrics target, output, output_mask)) File "E:\anaconda\envs\danncetest\lib\site-packages\tensorflow\python\keras\engine\training_v1.py", line 1904, in _handle_per_output_metrics with K.name_scope(metric_name): File "E:\anaconda\envs\danncetest\lib\site-packages\tensorflow\python\keras\backend.py", line 912, in name_scope return ops.name_scope_v2(name) File "E:\anaconda\envs\danncetest\lib\site-packages\tensorflow\python\framework\ops.py", line 6593, in __init__ raise ValueError("name for name_scope must be a string.") ValueError: name for name_scope must be a string.
So i put a pdb in 'File "f:\test_dannce\dannce\dannce\interface.py", line 1534, in dannce_predict;
(Pdb) from tensorflow.keras.models import load_model
(Pdb) custom_objects={ "ops": ops, "slice_input": nets.slice_input, "mask_nan_keep_loss": losses.mask_nan_keep_loss,"mask_nan_l1_loss": losses.mask_nan_l1_loss,"euclidean_distance_3D": losses.euclidean_distance_3D,"centered_euclidean_distance_3D": losses.centered_euclidean_distance_3D,} (Pdb) model = load_model(mdl_file,custom_objects)
*** ValueError: name for name_scope must be a string.
(Pdb) mdl_file, ('.\\DANNCE\\train_results\\MAX\\weights.1185-0.00001.hdf5',)
(Pdb) custom_objects {'ops': <module 'dannce.engine.ops' from 'f:\\test_dannce\\dannce\\dannce\\engine\\ops.py'>, 'slice_input': <function slice_input at 0x000001D3D4968AF8>, 'mask_nan_keep_loss': <function mask_nan_keep_loss at 0x000001D3D4950F78>, 'mask_nan_l1_loss': <function mask_nan_l1_loss at 0x000001D3D49684C8>, 'euclidean_distance_3D': <function euclidean_distance_3D at 0x000001D3D4968828>, 'centered_euclidean_distance_3D': <function centered_euclidean_distance_3D at 0x000001D3D49688B8>}
Does anyone know what happened? and any solutions? thank you so much @davidhildebrand @spoonsso