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

bump python to 3.12 in the test environment #3343

Merged
merged 6 commits into from
Feb 27, 2024
Merged

Conversation

njzjz
Copy link
Member

@njzjz njzjz commented Feb 27, 2024

Fix a bug caused by the breaking change in Keras 3 (shipped by TF 2.16).

@njzjz njzjz added the bug label Feb 27, 2024
@njzjz njzjz requested a review from wanghan-iapcm February 27, 2024 03:12
@njzjz njzjz marked this pull request as draft February 27, 2024 03:15
@njzjz
Copy link
Member Author

njzjz commented Feb 27, 2024

It seems Keras 3 does not support tf.compat.v1...

FAILED source/tests/tf/test_init_frz_model_se_atten.py::TestInitFrzModelAtten::test_single_frame - tensorflow.python.framework.errors_impl.NotFoundError: Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:

Graph execution error:

Detected at node 'save/RestoreV2' defined at (most recent call last):
    File "/opt/hostedtoolcache/Python/3.12.2/x64/bin/pytest", line 8, in <module>
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/config/__init__.py", line 198, in console_main
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/config/__init__.py", line 175, in main
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/pluggy/_hooks.py", line 501, in __call__
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/pluggy/_manager.py", line 119, in _hookexec
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/pluggy/_callers.py", line 102, in _multicall
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/main.py", line 320, in pytest_cmdline_main
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/main.py", line 273, in wrap_session
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/main.py", line 327, in _main
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/pluggy/_hooks.py", line 501, in __call__
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/pluggy/_manager.py", line 119, in _hookexec
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/pluggy/_callers.py", line 102, in _multicall
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/main.py", line 352, in pytest_runtestloop
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/pluggy/_hooks.py", line 501, in __call__
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/pluggy/_manager.py", line 119, in _hookexec
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/pluggy/_callers.py", line 102, in _multicall
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/runner.py", line 115, in pytest_runtest_protocol
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/runner.py", line 134, in runtestprotocol
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/runner.py", line 223, in call_and_report
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/runner.py", line 262, in call_runtest_hook
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/runner.py", line 342, in from_call
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/runner.py", line 263, in <lambda>
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/pluggy/_hooks.py", line 501, in __call__
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/pluggy/_manager.py", line 119, in _hookexec
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/pluggy/_callers.py", line 102, in _multicall
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/runner.py", line 170, in pytest_runtest_call
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/unittest.py", line 338, in runtest
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/unittest/case.py", line 690, in __call__
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/unittest/case.py", line 634, in run
    File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/unittest/case.py", line 589, in _callTestMethod
    File "/home/runner/work/deepmd-kit/deepmd-kit/source/tests/tf/test_init_frz_model_se_atten.py", line 225, in test_single_frame
    File "/home/runner/work/deepmd-kit/deepmd-kit/deepmd/tf/train/trainer.py", line 497, in _init_session
Node: 'save/RestoreV2'
Key attention_layer_0/layer_normalization_18/beta not found in checkpoint
	 [[{{node save/RestoreV2}}]]

Original stack trace for 'save/RestoreV2':
  File "/opt/hostedtoolcache/Python/3.12.2/x64/bin/pytest", line 8, in <module>
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/config/__init__.py", line 198, in console_main
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/config/__init__.py", line 175, in main
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/pluggy/_hooks.py", line 501, in __call__
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/pluggy/_manager.py", line 119, in _hookexec
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/pluggy/_callers.py", line 102, in _multicall
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/main.py", line 320, in pytest_cmdline_main
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/main.py", line 273, in wrap_session
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/main.py", line 327, in _main
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/pluggy/_hooks.py", line 501, in __call__
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/pluggy/_manager.py", line 119, in _hookexec
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/pluggy/_callers.py", line 102, in _multicall
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/main.py", line 352, in pytest_runtestloop
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/pluggy/_hooks.py", line 501, in __call__
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/pluggy/_manager.py", line 119, in _hookexec
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/pluggy/_callers.py", line 102, in _multicall
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/runner.py", line 115, in pytest_runtest_protocol
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/runner.py", line 134, in runtestprotocol
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/runner.py", line 223, in call_and_report
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/runner.py", line 262, in call_runtest_hook
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/runner.py", line 342, in from_call
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/runner.py", line 263, in <lambda>
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/pluggy/_hooks.py", line 501, in __call__
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/pluggy/_manager.py", line 119, in _hookexec
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/pluggy/_callers.py", line 102, in _multicall
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/runner.py", line 170, in pytest_runtest_call
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/_pytest/unittest.py", line 338, in runtest
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/unittest/case.py", line 690, in __call__
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/unittest/case.py", line 634, in run
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/unittest/case.py", line 589, in _callTestMethod
  File "/home/runner/work/deepmd-kit/deepmd-kit/source/tests/tf/test_init_frz_model_se_atten.py", line 225, in test_single_frame
  File "/home/runner/work/deepmd-kit/deepmd-kit/deepmd/tf/train/trainer.py", line 497, in _init_session
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/tensorflow/python/training/saver.py", line 934, in __init__
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/tensorflow/python/training/saver.py", line 946, in build
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/tensorflow/python/training/saver.py", line 974, in _build
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/tensorflow/python/training/saver.py", line 543, in _build_internal
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/tensorflow/python/training/saver.py", line 360, in _AddRestoreOps
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/tensorflow/python/training/saver.py", line 611, in bulk_restore
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/tensorflow/python/ops/gen_io_ops.py", line 1522, in restore_v2
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/tensorflow/python/framework/op_def_library.py", line 796, in _apply_op_helper
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/tensorflow/python/framework/ops.py", line [2682](https://github.com/njzjz/deepmd-kit/actions/runs/8058899323/job/22012415946#step:9:2683), in _create_op_internal
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/tensorflow/python/framework/ops.py", line 1177, in from_node_def

Copy link

codecov bot commented Feb 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.55%. Comparing base (4f70073) to head (4af3e1a).
Report is 1 commits behind head on devel.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #3343      +/-   ##
==========================================
+ Coverage   75.54%   75.55%   +0.01%     
==========================================
  Files         408      408              
  Lines       34300    34247      -53     
  Branches     1604     1604              
==========================================
- Hits        25912    25876      -36     
+ Misses       7527     7510      -17     
  Partials      861      861              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Jinzhe Zeng <[email protected]>
Signed-off-by: Jinzhe Zeng <[email protected]>
Signed-off-by: Jinzhe Zeng <[email protected]>
@njzjz njzjz marked this pull request as ready for review February 27, 2024 04:31
@wanghan-iapcm wanghan-iapcm added this pull request to the merge queue Feb 27, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 27, 2024
@njzjz njzjz enabled auto-merge February 27, 2024 05:57
@njzjz njzjz added this pull request to the merge queue Feb 27, 2024
Merged via the queue into deepmodeling:devel with commit 473cc0a Feb 27, 2024
48 checks passed
@njzjz njzjz deleted the py312 branch February 27, 2024 06:54
@njzjz njzjz added this to the v2.2.10 milestone Mar 17, 2024
@njzjz njzjz mentioned this pull request Apr 2, 2024
njzjz added a commit to njzjz/deepmd-kit that referenced this pull request Apr 6, 2024
Fix a bug caused by the breaking change in Keras 3 (shipped by TF 2.16).

---------

Signed-off-by: Jinzhe Zeng <[email protected]>
(cherry picked from commit 473cc0a)
Signed-off-by: Jinzhe Zeng <[email protected]>
@njzjz njzjz mentioned this pull request Apr 6, 2024
njzjz added a commit that referenced this pull request Apr 6, 2024
Fix a bug caused by the breaking change in Keras 3 (shipped by TF 2.16).

---------

Signed-off-by: Jinzhe Zeng <[email protected]>
(cherry picked from commit 473cc0a)
Signed-off-by: Jinzhe Zeng <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants