Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

完成训练无法进行predict #525

Open
ccandwj opened this issue Sep 24, 2024 · 0 comments
Open

完成训练无法进行predict #525

ccandwj opened this issue Sep 24, 2024 · 0 comments

Comments

@ccandwj
Copy link

ccandwj commented Sep 24, 2024

提问时请尽可能提供如下信息:

基本信息

  • 你使用的操作系统: win10
  • 你使用的Python版本: 3.8
  • 你使用的Tensorflow版本: 2.6.5
  • 你使用的Keras版本: 2.6.0
  • 你使用的bert4keras版本:
  • 你使用纯keras还是tf.keras:
  • 你加载的预训练模型:

核心代码

import ignnition
import matplotlib.pyplot as plt
from csv import reader
import os
import numpy as np
from statistics import mean
import time
def predict():
model = ignnition.create_model(model_dir='./')
start = time.time()
predictions = model.predict()
end = time.time()
print("Time elapsed: ", end - start)
calculate_test_set_results(predictions)
example_id = 0
plot_results_for_one_test_example(predictions, example_id)
predict()

输出信息

Processing the described model...

Creating the GNN model...

Traceback (most recent call last):
File "C:\anaconda\envs\ignnition_environment\lib\site-packages\tensorflow\python\training\py_checkpoint_reader.py", line 96, in NewCheckpointReader
return CheckpointReader(compat.as_bytes(filepattern))
RuntimeError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\graph-neural-network-state-estimation-main\graph-neural-network-state-estimation-main\predict.py", line 77, in
predict()
File "D:\graph-neural-network-state-estimation-main\graph-neural-network-state-estimation-main\predict.py", line 21, in predict
predictions = model.predict()
File "C:\anaconda\envs\ignnition_environment\lib\site-packages\ignnition\error_handling.py", line 484, in wrapper
return f(*args, **kwargs)
File "C:\anaconda\envs\ignnition_environment\lib\site-packages\ignnition\ignnition_model.py", line 818, in predict
self.__create_gnn(path=data_path, verbose=verbose, require_warm_start=True)
File "C:\anaconda\envs\ignnition_environment\lib\site-packages\ignnition\ignnition_model.py", line 548, in __create_gnn
self.gnn_model = self.__restore_model(gnn_model, sample=sample, require_warm_start=require_warm_start)
File "C:\anaconda\envs\ignnition_environment\lib\site-packages\ignnition\ignnition_model.py", line 575, in __restore_model
gnn_model.load_weights(checkpoint_path)
File "C:\anaconda\envs\ignnition_environment\lib\site-packages\keras\engine\training.py", line 2329, in load_weights
filepath, save_format = _detect_save_format(filepath)
File "C:\anaconda\envs\ignnition_environment\lib\site-packages\keras\engine\training.py", line 3014, in _detect_save_format
if _is_readable_tf_checkpoint(filepath):
File "C:\anaconda\envs\ignnition_environment\lib\site-packages\keras\engine\training.py", line 3035, in _is_readable_tf_checkpoint
tf.compat.v1.train.NewCheckpointReader(filepath)
File "C:\anaconda\envs\ignnition_environment\lib\site-packages\tensorflow\python\training\py_checkpoint_reader.py", line 100, in NewCheckpointReader
error_translator(e)
File "C:\anaconda\envs\ignnition_environment\lib\site-packages\tensorflow\python\training\py_checkpoint_reader.py", line 49, in error_translator
raise errors_impl.OpError(None, None, error_message, errors_impl.UNKNOWN)
tensorflow.python.framework.errors_impl.OpError

自我尝试

不管什么问题,请先尝试自行解决,“万般努力”之下仍然无法解决再来提问。此处请贴上你的努力过程。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant