在读取UnicodeDecodeError
文件时,我面临着json
的古老问题。
我存储文件:
model_json = model.to_json()
with open("trainedModel_-4_15.json", "w") as json_file:
json_file.write(model_json)
并阅读:
json_file = open('trainedModel_-4_15.json', 'rb')
loaded_model_json = json_file.read()
json_file.close()
loaded_model = model_from_json(loaded_model_json, {"tf":tf})
我尝试了网络上提到的各种方法,但都徒劳无功。