You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error while loading the model from json file in Keras
with open('config_mobilenet_aesthetic.json', 'r') as f:
model = model_from_json(f.read())
`---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
in ()
1 # Model reconstruction from JSON file
2 with open('config_mobilenet_aesthetic.json', 'r') as f:
----> 3 model = model_from_json(f.read())
4
5 #model = model_from_json('config_mobilenet_aesthetic.json')
/usr/local/lib/python2.7/dist-packages/keras/engine/saving.pyc in model_from_json(json_string, custom_objects)
488 A Keras model instance (uncompiled).
489 """
--> 490 config = json.loads(json_string)
491 from ..layers import deserialize
492 return deserialize(config, custom_objects=custom_objects)
/usr/lib/python2.7/json/init.pyc in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
337 parse_int is None and parse_float is None and
338 parse_constant is None and object_pairs_hook is None and not kw):
--> 339 return _default_decoder.decode(s)
340 if cls is None:
341 cls = JSONDecoder
/usr/lib/python2.7/json/decoder.pyc in decode(self, s, _w)
362
363 """
--> 364 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
365 end = _w(s, end).end()
366 if end != len(s):
/usr/lib/python2.7/json/decoder.pyc in raw_decode(self, s, idx)
380 obj, end = self.scan_once(s, idx)
381 except StopIteration:
--> 382 raise ValueError("No JSON object could be decoded")
383 return obj, end
ValueError: No JSON object could be decoded`
The text was updated successfully, but these errors were encountered:
Not quite sure what you are trying to do - config_mobilenet_aesthetic.json is not a model file, so you can‘t load this file with Keras. It just includes the configurations for training a model.
Error while loading the model from json file in Keras
with open('config_mobilenet_aesthetic.json', 'r') as f:
model = model_from_json(f.read())
`---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
in ()
1 # Model reconstruction from JSON file
2 with open('config_mobilenet_aesthetic.json', 'r') as f:
----> 3 model = model_from_json(f.read())
4
5 #model = model_from_json('config_mobilenet_aesthetic.json')
/usr/local/lib/python2.7/dist-packages/keras/engine/saving.pyc in model_from_json(json_string, custom_objects)
488 A Keras model instance (uncompiled).
489 """
--> 490 config = json.loads(json_string)
491 from ..layers import deserialize
492 return deserialize(config, custom_objects=custom_objects)
/usr/lib/python2.7/json/init.pyc in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
337 parse_int is None and parse_float is None and
338 parse_constant is None and object_pairs_hook is None and not kw):
--> 339 return _default_decoder.decode(s)
340 if cls is None:
341 cls = JSONDecoder
/usr/lib/python2.7/json/decoder.pyc in decode(self, s, _w)
362
363 """
--> 364 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
365 end = _w(s, end).end()
366 if end != len(s):
/usr/lib/python2.7/json/decoder.pyc in raw_decode(self, s, idx)
380 obj, end = self.scan_once(s, idx)
381 except StopIteration:
--> 382 raise ValueError("No JSON object could be decoded")
383 return obj, end
ValueError: No JSON object could be decoded`
The text was updated successfully, but these errors were encountered: