Skip to content

fix(pt): fix model_def_script#3671

Merged
wanghan-iapcm merged 1 commit intodeepmodeling:develfrom
njzjz:fix-model_def_script
Apr 15, 2024
Merged

fix(pt): fix model_def_script#3671
wanghan-iapcm merged 1 commit intodeepmodeling:develfrom
njzjz:fix-model_def_script

Conversation

@njzjz
Copy link
Copy Markdown
Member

@njzjz njzjz commented Apr 14, 2024

When executing

cd examples/water/se_e2_a
dp --pt train input.json
dp --pt freeze
dp convert-backend fromzen_model.pth frozen_model.pb
dp convert-backend fromzen_model.pb frozen_model.pth

An error throws in the last step:

TypeError: deepmd.tf.descriptor.descriptor.Descriptor() got multiple values for keyword argument 'ntypes'

The reason is that model_def_script is modified and further saved

model_params["descriptor"]["ntypes"] = ntypes

In the current code, model_def_script is modified, causing incompatibility with other backends.
@njzjz
Copy link
Copy Markdown
Member Author

njzjz commented Apr 14, 2024

In the current test, there are only tests for TF-TF, DP-DP, PT-PT, TF-DP, and PT-DP, but no tests for PT-TF, so it's impossible to find this issue.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.87%. Comparing base (3eb3d51) to head (3b230c2).

Additional details and impacted files
@@           Coverage Diff           @@
##            devel    #3671   +/-   ##
=======================================
  Coverage   81.87%   81.87%           
=======================================
  Files         503      503           
  Lines       46570    46571    +1     
  Branches     2952     2952           
=======================================
+ Hits        38129    38130    +1     
  Misses       7548     7548           
  Partials      893      893           

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

@wanghan-iapcm wanghan-iapcm added this pull request to the merge queue Apr 15, 2024
Merged via the queue into deepmodeling:devel with commit b3d6c70 Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants