deepmodeling / deepmd-kit

A deep learning package for many-body potential energy representation and molecular dynamics
https://docs.deepmodeling.com/projects/deepmd/
GNU Lesser General Public License v3.0
1.41k stars 487 forks source link

DEEPMD WARNING: The following nodes are not in the graph #3854

Closed Duanmu37 closed 1 month ago

Duanmu37 commented 1 month ago

Summary

After training the Deep Potential model, the log file mentions: "The following nodes are not in the graph: {'spin_attr/ntypes_spin', 'fitting_attr/aparam_nall'}."

DeePMD-kit Version

2.2.10

Backend and its version

2.16.1

Python Version, CUDA Version, GCC Version, LAMMPS Version, etc

No response

Details

After completing the model training, I used the dp freeze -o graph.pb command to freeze the model. Although the model was successfully frozen, some warnings appeared as shown below:

2024-06-04 20:14:20.163089: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: AVX2 AVX512F FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. WARNING:tensorflow:From /mnt/sg001/home/fz_licp_bzy/deepmd-kit/virtualenv/tensorflow/lib/python3.10/site-packages/tensorflow/python/compat/v2_compat.py:98: disable_resource_variables (from tensorflow.python.ops.resource_variables_toggle) is deprecated and will be removed in a future version. Instructions for updating: non-resource variables are not supported in the long term WARNING:tensorflow:Your environment has TF_USE_LEGACY_KERAS set to True, but you do not have the tf_keras package installed. You must install it in order to use the legacy tf.keras. Install it via: pip install tf_keras 2024-06-04 20:14:53.211848: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:388] MLIR V1 optimization pass is not enabled DEEPMD WARNING The following nodes are not in the graph: {'fitting_attr/aparam_nall', 'spin_attr/ntypes_spin'}. Skip freezing these nodes. You may be freezing a checkpoint generated by an old version. DEEPMD INFO The following nodes will be frozen: ['o_atom_virial', 'descrpt_attr/rcut', 'fitting_attr/daparam', 'o_virial', 'descrpt_attr/ntypes', 'model_attr/model_version', 'o_atom_energy', 'model_attr/tmap', 'train_attr/training_script', 'o_energy', 'fitting_attr/dfparam', 'model_attr/model_type', 'train_attr/min_nbor_dist', 't_mesh', 'o_force', 'model_type'] WARNING:tensorflow:From /mnt/sg001/home/fz_licp_bzy/deepmd-kit/virtualenv/tensorflow/lib/python3.10/site-packages/deepmd/entrypoints/freeze.py:371: convert_variables_to_constants (from tensorflow.python.framework.convert_to_constants) is deprecated and will be removed in a future version. Instructions for updating: This API was designed for TensorFlow v1. See https://www.tensorflow.org/guide/migrate for instructions on how to migrate your code to TensorFlow v2. WARNING:tensorflow:From /mnt/sg001/home/fz_licp_bzy/deepmd-kit/virtualenv/tensorflow/lib/python3.10/site-packages/tensorflow/python/framework/convert_to_constants.py:946: extract_sub_graph (from tensorflow.python.framework.graph_util_impl) is deprecated and will be removed in a future version. Instructions for updating: This API was designed for TensorFlow v1. See https://www.tensorflow.org/guide/migrate for instructions on how to migrate your code to TensorFlow v2. DEEPMD INFO 1192 ops in the final graph.

Subsequently, I used this model file in LAMMPS for simulation, which resulted in the following error:

INVALID_ARGUMENT: Tensor spin_attr/ntypes_spin:0, specified in either feed_devices or fetch_devices was not found in the Graph INVALID_ARGUMENT: Tensor spin_attr/ntypes_spin:0, specified in either feed_devices or fetch_devices was not found in the Graph INVALID_ARGUMENT: Tensor spin_attr/ntypes_spin:0, specified in either feed_devices or fetch_devices was not found in the Graph INVALID_ARGUMENT: Tensor spin_attr/ntypes_spin:0, specified in either feed_devices or fetch_devices was not found in the Graph ...... ......

I would like to know how to resolve the issue of missing nodes in the model. If additional information is needed, please let me know.Any assistance to resolve this issue would be greatly appreciated.

njzjz commented 1 month ago

The missing of these nodes is expected. #3381 removed the incorrect warning.