serengil / tensorflow-101

TensorFlow 101: Introduction to Deep Learning

Home Page:https://www.youtube.com/watch?v=YjYIMs5ZOfc&list=PLsS_1RYmYQQGxpKV44jsxXNgjEpRoW61w&index=2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

model_from_json(open("facial_expression_model_structure.json", "r").read())

abhishekpalit09 opened this issue · comments

#face expression recognizer initialization
model = model_from_json(open("facial_expression_model_structure.json", "r").read())

This code generates the following issue:
Traceback (most recent call last):
File "C:/Users/palitabhishek/Documents/Analysis/Face_Recognition/test.py", line 4, in
model = model_from_json(open("facial_expression_model_structure.json", "r").read())
File "C:\Users\palitabhishek\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\engine\saving.py", line 490, in model_from_json
config = json.loads(json_string)
File "C:\Users\palitabhishek\AppData\Local\Programs\Python\Python36\lib\json_init_.py", line 354, in loads
return _default_decoder.decode(s)
File "C:\Users\palitabhishek\AppData\Local\Programs\Python\Python36\lib\json\decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\palitabhishek\AppData\Local\Programs\Python\Python36\lib\json\decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 7 column 1 (char 6)

Please help me correct the same.

1- Please confirm that both facial_expression_model_structure.json and test.py files are put in the same directory and json file copied from this link: https://github.com/serengil/tensorflow-101/blob/master/model/facial_expression_model_structure.json

2- Please confirm that you and me have same python, tensorflow and keras environments. My environment versions are:

(tensorflow) C:\Users\IS96273>python --version
Python 3.5.5 :: Anaconda, Inc.

import tensorflow as tf
print(tf.version)
1.9.0

import keras
print(keras.version)
2.2.0