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

Fix test errors with TensorFlow 2.7 #1315

Merged
merged 6 commits into from
Nov 29, 2021

Conversation

njzjz
Copy link
Member

@njzjz njzjz commented Nov 29, 2021

This PR fixes test errors with the new TensorFlow packages that I uploaded today.

@njzjz njzjz changed the title Fix tf2.7 tests Fix test errors with TensorFlow 2.7 Nov 29, 2021
@codecov-commenter
Copy link

codecov-commenter commented Nov 29, 2021

Codecov Report

Merging #1315 (0d73bef) into devel (833c059) will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##            devel    #1315      +/-   ##
==========================================
- Coverage   75.64%   75.62%   -0.03%     
==========================================
  Files          86       91       +5     
  Lines        7484     7498      +14     
==========================================
+ Hits         5661     5670       +9     
- Misses       1823     1828       +5     
Impacted Files Coverage Δ
source/lib/include/SimulationRegion.h 100.00% <0.00%> (ø)
source/api_cc/include/DeepTensor.h 20.00% <0.00%> (ø)
source/api_cc/include/DataModifier.h 100.00% <0.00%> (ø)
source/api_cc/include/DeepPot.h 66.66% <0.00%> (ø)
source/lib/include/neighbor_list.h 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 833c059...0d73bef. Read the comment docs.

@wanghan-iapcm wanghan-iapcm merged commit 29e59d3 into deepmodeling:devel Nov 29, 2021
@njzjz njzjz deleted the fix-tf2.7-tests branch December 21, 2021 23:39
njzjz added a commit to njzjz/deepmd-kit that referenced this pull request Sep 21, 2023
This PR updates all JSON files:
- convert `default_training_param` to v2 format
- format JSON files
- update `_comment` to `_commentN` to avoid duplicated keys
- enable `check-json` and `pretty-format-json` hooks

```py
import json
from glob import glob

from deepmd.utils.compat import update_deepmd_input, convert_input_v1_v2

for ii in glob("**/*.json", recursive=True):
    with open(ii) as f:
        content = f.read()
    count = 1
    while True:
        if r'"_comment"' not in content:
            break
        content = content.replace('"_comment"', '"_comment%d"' % count, 1)
        count += 1
    try:
        jdata = json.loads(content)
    except Exception as e:
        print(ii, e)
        continue
    if "default_training_param" in jdata:
        jdata["default_training_param"] = update_deepmd_input(
            jdata["default_training_param"], warning=False)
        if "decay_rate" in jdata["default_training_param"]["learning_rate"]:
            jdata["default_training_param"] = convert_input_v1_v2(
                jdata["default_training_param"], warning=False)
        if "load_ckpt" in jdata["default_training_param"]["training"]:
            del jdata["default_training_param"]["training"]["load_ckpt"]
    content = json.dumps(jdata, indent=2)

    with open(ii, "w") as f:
        f.write(content)
```

---------

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

None yet

3 participants