ognjenkundacina / graph-neural-network-state-estimation

gnn_se
5 stars 0 forks source link

load_model_path #1

Closed mine7519 closed 1 year ago

mine7519 commented 1 year ago

Hi When I predict the model, I add the following line of code to the train_options.yaml: load_model_path: ./CheckPoint/experiment_2022_11_09_18_03_58/ckpt/weights.05-0.000 but when I run ‘predict.py’ file, I got an error that I can't fix As follows:

Processing the described model...

Creating the GNN model...

Traceback (most recent call last): File "D:\Anaconda3\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 "C:/Users/Zz/Desktop/graph-neural-network-state-estimation/predict.py", line 69, in predict() File "C:/Users/Zz/Desktop/graph-neural-network-state-estimation/predict.py", line 14, in predict predictions = model.predict() File "D:\Anaconda3\envs\ignnition_environment\lib\site-packages\ignnition\error_handling.py", line 484, in wrapper return f(*args, **kwargs) File "D:\Anaconda3\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 "D:\Anaconda3\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 "D:\Anaconda3\envs\ignnition_environment\lib\site-packages\ignnition\ignnition_model.py", line 575, in restore_model gnn_model.load_weights(checkpoint_path) File "D:\Anaconda3\envs\ignnition_environment\lib\site-packages\keras\engine\training.py", line 2329, in load_weights filepath, save_format = _detect_save_format(filepath) File "D:\Anaconda3\envs\ignnition_environment\lib\site-packages\keras\engine\training.py", line 3014, in _detect_save_format if _is_readable_tf_checkpoint(filepath): File "D:\Anaconda3\envs\ignnition_environment\lib\site-packages\keras\engine\training.py", line 3035, in _is_readable_tf_checkpoint tf.compat.v1.train.NewCheckpointReader(filepath) File "D:\Anaconda3\envs\ignnition_environment\lib\site-packages\tensorflow\python\training\py_checkpoint_reader.py", line 100, in NewCheckpointReader error_translator(e) File "D:\Anaconda3\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

Please help me

ognjenkundacina commented 1 year ago

Hello!

The problem does not seem to reproduce in my environment. Can you please check the version of your ignnition package?

Also if you have more details that may be helpful, could you send them, like the directory structure of you project, the train_options.yaml file...

Regards, Ognjen

mine7519 commented 1 year ago

Hello!

The version of my ignnition package is 1.7.0 The version of my tensorflow package is 2.6.5 The version of my keras package is 2.6.0 ...

Could you tell me the versions of all your packages?

I think it might be a package version issue

Thanks

ognjenkundacina commented 1 year ago

Hello,

The versions are exactly the same. If you want you can send me your code (e.g., zip the repository just without the training set), so I can check it.

mine7519 commented 1 year ago

Hello,

my code is debugged.

In fact, I'm using your code but just running it on my computer.

'predict.py' that was previously unexecutable

I just changed the version of the ignnition package to 1.4.1, then re-execute the 'train.py', then re-execute the 'predict.py'.

Although the code can be executed, but I still don't know what is causing this.

Attached below is my code.

Thanks

------------------ 原始邮件 ------------------ 发件人: "ognjenkundacina/graph-neural-network-state-estimation" @.>; 发送时间: 2022年11月10日(星期四) 下午4:57 @.>; @.**@.>; 主题: Re: [ognjenkundacina/graph-neural-network-state-estimation] load_model_path (Issue #1)

Hello,

The versions are exactly the same. If you want you can send me your code (e.g., zip the repository just without the training set), so I can check it.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

从QQ邮箱发来的超大附件

graph-neural-network-state-estimation.rar (9.67M, 无限期)进入下载页面:http://mail.qq.com/cgi-bin/ftnExs_download?k=6f38653393740499d04177371e325349575d54075d0158001c595d555d1f5505065b48510a02554b535d04000e04595e085b010a381b61014359155b155c04134359091e565715115e4a0e1e4b460012541500404c5b0c0745510a5d164000143105&t=exs_ftn_download&code=18e382af

ognjenkundacina commented 1 year ago

I've executed the code you have sent in my current environment, and also in a newly created one (anaconda environment, ignnition installed using pip) and both train and predict scripts work fine.

Did you install ignnition in an existing environment, or a new one? Could it be that there is some kind of conflict with some of the existing packages in your current environment?

However, if the script is executing successfully with ignnition 1.4.1, the results it returns should be fine too.

mine7519 commented 1 year ago

Hello,

I install ignnition in an new environment.

I think there is not some kind of conflict with some of the existing packages in my previous environment and current environment, because I installed using the ’pip install -r requirements.txt’.

Anyway, thanks for your answer.

If I encounter other problems later, I still hope to get your help.

------------------ 原始邮件 ------------------ 发件人: "ognjenkundacina/graph-neural-network-state-estimation" @.>; 发送时间: 2022年11月10日(星期四) 晚上6:16 @.>; @.**@.>; 主题: Re: [ognjenkundacina/graph-neural-network-state-estimation] load_model_path (Issue #1)

I've executed the code you have sent in my current environment, and also in a newly created one (anaconda environment, ignnition installed using pip) and both train and predict scripts work fine.

Did you install ignnition in an existing environment, or a new one? Could it be that there is some kind of conflict with some of the existing packages in your current environment?

However, if the script is executing successfully with ignnition 1.4.1, the results it returns should be fine too.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

ognjenkundacina commented 1 year ago

Sure! I'll close this issue for now