Skip to content

fix 'NoneType' has no len() in auto_sel#911

Merged
amcadmus merged 1 commit into
deepmodeling:develfrom
njzjz:fix-nonetype-has-no-len
Aug 1, 2021
Merged

fix 'NoneType' has no len() in auto_sel#911
amcadmus merged 1 commit into
deepmodeling:develfrom
njzjz:fix-nonetype-has-no-len

Conversation

@njzjz

@njzjz njzjz commented Aug 1, 2021

Copy link
Copy Markdown
Member

The default value of type_map is None, so when you don't set type_map, you'll get this error.

return jdata['model'].get('type_map', None)

@njzjz njzjz requested a review from amcadmus August 1, 2021 05:36
@codecov-commenter

codecov-commenter commented Aug 1, 2021

Copy link
Copy Markdown

Codecov Report

Merging #911 (0996d05) into devel (31f1ef6) will decrease coverage by 0.07%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            devel     #911      +/-   ##
==========================================
- Coverage   74.65%   74.57%   -0.08%     
==========================================
  Files          85       85              
  Lines        6730     6745      +15     
==========================================
+ Hits         5024     5030       +6     
- Misses       1706     1715       +9     
Impacted Files Coverage Δ
deepmd/entrypoints/train.py 75.00% <0.00%> (ø)
deepmd/entrypoints/doc.py 33.33% <0.00%> (-26.67%) ⬇️
deepmd/descriptor/se_a.py 97.56% <0.00%> (-1.37%) ⬇️
deepmd/utils/argcheck.py 87.54% <0.00%> (-0.23%) ⬇️
deepmd/descriptor/se_r.py 92.85% <0.00%> (ø)
deepmd/entrypoints/main.py 88.42% <0.00%> (+0.12%) ⬆️

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 31f1ef6...0996d05. Read the comment docs.

@njzjz

njzjz commented Aug 1, 2021

Copy link
Copy Markdown
Member Author

By the way, can we let the auto-sel calculation become a default behavior, and throw a RuntimeError when it's more than those set by users? Usually we will get a bad model if sel is not enough for training data. It wastes time to train such a model.

@amcadmus

amcadmus commented Aug 1, 2021

Copy link
Copy Markdown
Member

By the way, can we let the auto-sel calculation become a default behavior, and throw a RuntimeError when it's more than those set by users? Usually we will get a bad model if sel is not enough for training data. It wastes time to train such a model.

We should allow the users setting a small sel and warn them that they are using a too small sel and they really know what they are doing.

@amcadmus amcadmus merged commit b5b15fa into deepmodeling:devel Aug 1, 2021
@njzjz njzjz deleted the fix-nonetype-has-no-len branch August 12, 2021 22:20
gzq942560379 pushed a commit to HPC-AI-Team/deepmd-kit that referenced this pull request Sep 2, 2021
njzjz added a commit to njzjz/deepmd-kit that referenced this pull request Sep 21, 2023
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.

3 participants