Git Product home page Git Product logo

simple-nn's Introduction

New version release!

A new version of SIMPLE-NN has been released.

It provides faster training speed and more convenient usage with Pytorch.

You can download and enjoy the new SIMPLE-NN from https://github.com/MDIL-SNU/SIMPLE-NN_v2.git

SIMPLE-NN on this page will be deprecated soon.

SIMPLE-NN

SIMPLE-NN(SNU Interatomic Machine-learning PotentiaL packagE – version Neural Network)

If you use SIMPLE-NN, please cite this article:

K. Lee, D. Yoo, W. Jeong, S. Han, SIMPLE-NN: An efficient package for training and executing neural-network interatomic potentials, Computer Physics Communications (2019), https://doi.org/10.1016/j.cpc.2019.04.014.

Here do we describe minimal instruction to run the example of SIMPLE-NN If you want more information such as tuning parameters, please visit our online manual(https://simple-nn.readthedocs.io)

Installation

SIMPLE-NN use Tensorflow and mpi4py(optional). You need to install Tensorflow and mpi4py to use SIMPLE-NN

install Tensorflow: https://www.tensorflow.org/install/

install mpi4py:

pip install mpi4py

From github

git clone https://github.com/MDIL-SNU/SIMPLE-NN.git
cd SIMPLE-NN
python setup.py install

Install LAMMPS' module

Currently, we support the module for symmetry_function - Neural_network model. Copy the source code to LAMMPS src directory.

cp /directory/of/simple-nn/features/symmetry_function/pair_nn.* /directory/of/lammps/src/
cp /directory/of/simple-nn/features/symmetry_function/symmetry_function.h /directory/of/lammps/src/

And compile LAMMPS code. Only LAMMPS whose version is 29Oct2020 or later is supported.

Usage

To use SIMPLE-NN, 3 types of files (input.yaml, params_XX, str_list) are required.

input.yaml

Parameter list to control SIMPLE-NN code is listed in input.yaml. The simplest form of input.yaml is described below:

# input.yaml
generate_features: true
preprocess: true
train_model: true
atom_types:
 - Si
 - O

symmetry_function:
  params:
    Si: params_Si
    O: params_O
  # GDF setting
  #atomic_weights:
  #  type: gdf
  
neural_network:
  method: Adam
  nodes: 30-30

params_XX

params_XX (XX means atom type that is included your target system) indicates the coefficients of symmetry functions. Each line contains coefficients for one symmetry function. detailed format is described below:

2 1 0 6.0 0.003214 0.0 0.0
2 1 0 6.0 0.035711 0.0 0.0
4 1 1 6.0 0.000357 1.0 -1.0
4 1 1 6.0 0.028569 1.0 -1.0
4 1 1 6.0 0.089277 1.0 -1.0

First one indicates the type of symmetry function. Currently G2, G4 and G5 is available.

Second and third indicates the type index of neighbor atoms which starts from 1. For radial symmetry function, 1 neighbor atom is need to calculate the symmetry function value. Thus, third parameter is set to zero. For angular symmtery function, 2 neighbor atom is needed. The order of second and third do not affect to the calculation result.

Fourth one means the cutoff radius for cutoff function.

The remaining parameters are the coefficients applied to each symmetry function.

str_list

str_list contains the location of reference calculation data. The format is described below:

/location/of/calculation/data/oneshot_output_file :
/location/of/calculation/data/MDtrajectory_output_file 100:2000:20
/location/of/calculation/data/same_folder_format{1..10}/oneshot_output_file :

Script for running SIMPLE-NN

After preparing input.yaml, params_XX and str_list, one can run SIMPLE-NN using the script below:

"""
Run the code below:
    python run.py

run.py:
"""

from simple_nn import Simple_nn
from simple_nn.features.symmetry_function import Symmetry_function
from simple_nn.models.neural_network import Neural_network

model = Simple_nn('input.yaml', 
                   descriptor=Symmetry_function(), 
                   model=Neural_network())
model.run()

Example

In examples folder, one can find MD trajectories of bulk SiO2, corresponding input files (input.yaml, params_Si, params_O and str_list) and python script run.py. To use this example, one simply change the location in the 'str_list' file and run 'Python run.py' command.

simple-nn's People

Contributors

jisujung928 avatar nanco-l avatar will1792 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simple-nn's Issues

ModuleNotFoundError: No module named 'simple_nn.utils._libgdf'

Hi,
I have installed all the dependencies of SIMPLE-NN but I am getting following error:

import simple_nn
Traceback (most recent call last):
File "", line 1, in
File "/home/psrg/software/SIMPLE-NN/simple_nn/init.py", line 5, in
from .utils import modified_sigmoid, _generate_gdf_file
File "/home/psrg/software/SIMPLE-NN/simple_nn/utils/init.py", line 5, in
from ._libgdf import lib, ffi
ModuleNotFoundError: No module named 'simple_nn.utils._libgdf'

Kindly help me in resolving this issue asap.

tf.assign function error

Hello. I am running the example in SiO2/generate_NNP using Python version 3.7.7, Simple-NN version 20.2, and TensorFlow version 2.6.0.

However, I am receiving an error message that states TensorFlow does not have a certain attribute. Do you have any suggestion on how I can resolve this issue? Thanks!

This is the error message I get when I try to run the run.py script:

Traceback (most recent call last):
File "run.py", line 7, in
model=Neural_network())
File "/share/apps/python-3.7.7/lib/python3.7/site-packages/simple_nn-20.2-py3.7-linux-x86_64.egg/simple_nn/models/neural_network.py", line 93, in init
self.increment_global_step = tf.assign(self.global_step, self.global_step+1)
AttributeError: module 'tensorflow' has no attribute 'assign'

Error: No module named simple_nn

Hello, I am running the example in SiO2/generate_NNP using Python version 3.6.14, Simple-NN version 20.2, and TensorFlow version 1.13.2.

When I try to run the run.py script, I get an error message:
python3 run py error

Any suggestions? Thanks!

Potential Test

Hi,
in the documentation (Release 0.7.0) is written that the test_result file includes DFT energies/forces, NNP energies/forces but when I open the file in jupyter, the saved dictionary in the file contains only (dict_keys(['DFT_E', 'NN_E', 'N'])) energies and a third entry named 'N' where only one number per test geometry is saved which is always the same integer number. I trained the NN for bulk silicon with forces and energy and my question is why I don't get the forces in the test_result file? The input.yaml file which I used for error testing is below

generate_features: false
preprocess: false
train_model: true
atom_types:

  • Si

symmetry_function:
params:
Si: params_Si

neural_network:
method: L-BFGS
nodes: 30-30
batch_size: 10
full_batch: true
train: false
test: true
continue: true

Slightly Inaccurate Fingerprints?

Hello,
I was looking over the fingerprints and believe there is a small bug somewhere in their calculation. I built a cell with two oxygens at a distance of 1.2A and used simple_nn to calculate the g2 fingerprint with eta = 0.005 and Rc = 4. When I look at simple_nn's pickle outputs I find the value of 0.7881971276371487 for this fingerprint, but when I do this on my calculator, pure python, and from other NNFF software I get 0.7935354548340433. This is off by ~ 1% but is slightly concerning as the values should be more or less dead on. I have seen a slightly larger difference in the fingerprint primes when comparing to other software as well. Below is my code for calculating the fingerprint value.

from ase.build import molecule
import numpy as np

atoms = molecule('O2')
atoms.set_cell([10,10,10])
atoms.positions = np.array([[0,0,0],[0,0,1.2]])
d = atoms.positions[0][2]-atoms.positions[1][2]
print(d)


g2_eta = 0.005
cutoff = 4

g = np.exp(-1 * g2_eta * (d/cutoff) ** 2) * 0.5 * (np.cos(np.pi * (d/cutoff)) + 1)
print(g)

params_XX file: type index of neighbor atoms determined by order of elements in input.yaml or alphabetical?

I want to define a different set of symmetry functions for each element but I am not exactly sure how the "type index of neighbor atoms"is defined. The documentation for the params_XX file says:

Second and third indicates the type index of neighbor atoms which starts from 1.

How does the index starting at 1 correspond to the elements in the system? Is it from how they're ordered in the input.yaml file? Is it by alphabetical order of the elements? Something else?

Thanks! - Eric

License ?

Hello, I wonder what is the license of this software.
Thanks

Error: No module named 'simple_nn.utils._libgdf'

I used the install procedure mentioned in the documentation. When trying to import Simple_nn (from simple_nn import Simple_nn), I am getting the following error:

File "............/softwares/SIMPLE-NN/simple_nn/utils/init.py", line 5, in
from ._libgdf import lib, ffi
ModuleNotFoundError: No module named 'simple_nn.utils._libgdf'

Can you please help me fix this issue ?

Different fingerprints for the same atom

Hi,

I used the fingerprinting scheme from SIMPLE-NN but I think there could be an issue in the calculate_sf function. For an ASE atoms generated from the following code
from ase.build import bulk atoms = bulk('Cu').repeat((3,3,3))
all the atoms are identical. As a result, the fingerprints for each atom in the atoms should be the same. However, the fingerprints generated from SIMPLE-NN for each atom are different.

Specifically, I used one G2 with eta = 0.05, and cutoff = 6. The values look like the following:
tensor([[8.0695],
[8.0042],
[7.6038],
[7.9458],
[7.9850],
[7.7613],
[8.0695],
[7.9335],
[7.8366],
[7.9458],
[7.9850],
[7.7613],
[7.8221],
[7.9995],
[7.8896],
[7.7130],
[8.0187],
[7.9795],
[8.0695],
[7.9335],
[7.8366],
[7.7130],
[8.0187],
[7.9795],
[7.8366],
[7.9335],
[8.0695]], requires_grad=True)

Any idea what could lead to this problem? Thanks!

Best,
Mingjie

Outdated dependencies

1. TypeError: read_vasp_out() got an unexpected keyword argument 'force_consistent'
2. It is particularly hard to install tf1 because of outdated requirements (specifically, python3.7).

LAMMPS segmentation fault error when using 5 elements

SIMPLE-NN (20.2) and LAMMPS (3Mar20)

  • training and LAMMPS run went ok for 1, 2, 4 elements
  • training was fine for 5 elements but LAMMPS always gave the segmentation error. It seems that the error happened when reading the potential file.

debugging with valgrind
==2624== Process terminating with default action of signal 11 (SIGSEGV)
==2624== Access not within mapped region at address 0x0
==2624== at 0xBC55A84: ____strtod_l_internal (in /usr/lib64/libc-2.17.so)
==2624== by 0x75C4BD: LAMMPS_NS::PairNN::read_file(char*) (in /mnt/ufs18/rs-006/lai-lab/Codes-C7/lammps-3Mar20/src/lmp_seriali)
==2624== by 0x75B481: LAMMPS_NS::PairNN::coeff(int, char**) (in /mnt/ufs18/rs-006/lai-lab/Codes-C7/lammps-3Mar20/src/lmp_seriali)
==2624== by 0x45C212: LAMMPS_NS::Input::execute_command() (in /mnt/ufs18/rs-006/lai-lab/Codes-C7/lammps-3Mar20/src/lmp_seriali)
==2624== by 0x45D808: LAMMPS_NS::Input::file() (in /mnt/ufs18/rs-006/lai-lab/Codes-C7/lammps-3Mar20/src/lmp_seriali)
==2624== by 0x715905: main (in /mnt/ufs18/rs-006/lai-lab/Codes-C7/lammps-3Mar20/src/lmp_seriali)
==2624== If you believe this happened as a result of a stack
==2624== overflow in your program's main thread (unlikely but
==2624== possible), you can try to increase the size of the
==2624== main thread stack using the --main-stacksize= flag.
==2624== The main thread stack size used in this run was 16777216.
==2624==
==2624== HEAP SUMMARY:
==2624== in use at exit: 2,066,472 bytes in 1,952 blocks
==2624== total heap usage: 2,838 allocs, 886 frees, 2,511,490 bytes allocated
==2624==
==2624== LEAK SUMMARY:
==2624== definitely lost: 0 bytes in 0 blocks
==2624== indirectly lost: 0 bytes in 0 blocks
==2624== possibly lost: 0 bytes in 0 blocks
==2624== still reachable: 2,066,472 bytes in 1,952 blocks
==2624== suppressed: 0 bytes in 0 blocks
==2624== Rerun with --leak-check=full to see details of leaked memory
==2624==
==2624== Use --track-origins=yes to see where uninitialised values come from
==2624== For lists of detected and suppressed errors, rerun with: -s
==2624== ERROR SUMMARY: 642 errors from 12 contexts (suppressed: 0 from 0)
Segmentation fault

debugging with gdb
Program received signal SIGSEGV, Segmentation fault.
0x00002aaab1aeda84 in ____strtod_l_internal () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install glibc-2.17-317.el7.x86_64
(gdb) where
#0 0x00002aaab1aeda84 in ____strtod_l_internal () from /lib64/libc.so.6
#1 0x000000000075c4be in LAMMPS_NS::PairNN::read_file(char*) ()
#2 0x000000000075b482 in LAMMPS_NS::PairNN::coeff(int, char**) ()
#3 0x000000000045c213 in LAMMPS_NS::Input::execute_command() ()
#4 0x000000000045d809 in LAMMPS_NS::Input::file() ()
#5 0x0000000000715906 in main ()

Generating symmetry function features for different atom types

Sorry if this question is not appropriate but it didn't seem clear in the documentation - how would one go about generating the symmetry function features for different atom types besides the SiO2 example? Specifically I am trying to generate a NN potential using a LAMMPS dump file of NaCl. Would you pass this dump file to the generate() function in the symmetry_function module somehow?

Generating G5 using Simple-NN

As far as I can tell when using this package one would just use the G2 and G4 parameters in the SiO2 example and change the file name accordingly. Is it possible to generate the G5 parameters using Simple-NN or is that outside the scope of the intention of this package?

Memory Leak issue

Hello,
I am trying to iteratively generate symmetry functions for atoms.
However, I'm having a memory leak issue. It looks like the memory is not released after computing the symmetry function. Not sure whether I need to use garbage-collector or something similar for C code to release the memory. Do you have any comment or thoughts about it? It's an important issue because I'm trying to iterate the computation for ~1M iterations.

A bug in computing neighbors

I suspect there is a bug which misses some pairs. Following is the information I can share right now:

I cannot reproduce specific descriptors from structure 334 in the SiO2 example you provide. The index 334 is counting from zero. It corresponds to index 3340 (counting from zero) of the original chain of VASP structures in OUTCAR_comp. The mismatch is (here and further counting is from zero):

  • all descriptors of Oxygen 5 except O-Si and O-Si-Si;
  • all descriptors of Oxygen 28 except O-Si;
  • all descriptors of Silicons 9 and 10 except Si-Si and Si-Si-Si.

There may be other discrepancies which are below numerical threshold 1e-12.

I think I nailed down the problem with pair descriptors of Oxygen 5 and 28: there, expectedly, the pair O#5-O#28 is missing from sums. This is what I computed vs what you code gives (I was reading descriptors from individual pickle files your example saves at some point):

Oxygen #5 O-O descriptors
eta=0.0032 mine=8.174 yours=8.154 diff=2.002e-02
eta=0.0357 mine=5.556 yours=5.548 diff=7.678e-03
eta=0.0714 mine=3.785 yours=3.782 diff=2.678e-03
eta=0.1250 mine=2.255 yours=2.254 diff=5.515e-04
eta=0.2143 mine=1.048 yours=1.048 diff=3.962e-05
eta=0.3571 mine=0.349 yours=0.349 diff=5.861e-07
eta=0.7142 mine=0.028 yours=0.028 diff=1.560e-11

Assuming only a single term is missing it is easy to deduce that your implementation differs from my implementation by one Behler function with r=5.43115469 which is present in my case but absent in yours. This distance corresponds almost exactly to the distance between O#5-O#28 in neighboring supercells.

I do not know where exactly the problem is but I kindly ask to investigate this. Other 399 cells which I tested seem to show perfect agreement.

potential for systems with different number of elements

potential_saved_iteration50001 in the example was trained for SiO2. Although not intended, I found I could use this potential to run LAMMPS for Si by specifying "pair_coeff * * potential_saved_iteration50001 Si" and even a virtual O system by doing something similar.

I tried a potential with three elements (Cu-Sb-S). I could run LAMMPS with this potential to systems with three elements (Cu-Sb-S), systems with two elements (Cu-Sb, Cu-S, Sb-S), but not with systems with single elements (Cu, Sb, or S). It gave the "munmap_chunk(): invalid pointer: 0x00000000021b3c80 ***". I am using lammps-3Mar20.

Similarly, a potential trained with four elements can only be applied to systems with three or four elements, but not two and one elements.

The broader context of this is to train the potential with multiple datasets with different number of elements.

Scaling taking long time

After the pickle files are generated, the scaling of fingerprints is taking very long. The Log file has not updated for almost 4-5 hours. I don't think it's a memory issue since I have been monitoring the hvmem of my job. Can someone help me troubleshoot this?

_pickle.UnpicklingError: invalid load key, '\x00'.

I am trying to use simple NN over a large training dataset. My dataset is in ase trajectory file (I have added "refdata_format: traj" in my input.yaml file). Once all the pickle files are for the input dataset are created, the LOG file writes:
PATH/all_train.traj :: ~./data/data20427.pickle

(where all_train.traj is my trajectory file containing 20426 structures)

And my error file gives me the error:

File "/u/home/v/vsumaria/.local/lib/python3.6/site-packages/simple_nn-20.1-py3.6-linux-x86_64.egg/simple_nn/utils/init.py", line 32, in pickle_load
return pickle.load(fil, encoding='latin1')
_pickle.UnpicklingError: invalid load key, '\x00'.

Can someone help me understand what is going wrong ?

"Cannot convert a partially known TensorShape to a Tensor: %s" % s) ValueError: Cannot convert a partially known TensorShape to a Tensor: (?,)

How can I solve this error?

I've configured the environment I need: tf1.8 and python3.6,when I ran the examples/SiO2/generate_NNP/run.py or examples/SiO2/error_check/run.py,I found this ValueError: "Cannot convert a partially known TensorShape to a Tensor: %s" % s) ValueError: Cannot convert a partially known TensorShape to a Tensor: (?,).

This error traceback: tf.unsorted_segment_mean(self.e_loss, self.next_elem['struct_ind'], tf.size(self.next_elem['struct_type_set'])).

  • examples/SiO2/generate_NNP/run.py
Traceback (most recent call last):
  File "/home/hjchen/anaconda3/envs/tf1.8/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 1757, in ones
    tensor_shape.TensorShape(shape))
  File "/home/hjchen/anaconda3/envs/tf1.8/lib/python3.6/site-packages/tensorflow/python/framework/constant_op.py", line 256, in _tensor_shape_tensor_conversion_function
    "Cannot convert a partially known TensorShape to a Tensor: %s" % s)
ValueError: Cannot convert a partially known TensorShape to a Tensor: (?,)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "run.py", line 6, in <module>
    model.run()
  File "/home/hjchen/anaconda3/envs/tf1.8/lib/python3.6/site-packages/simple_nn-20.2-py3.6-linux-x86_64.egg/simple_nn/__init__.py", line 197, in run
    self.model.train(user_optimizer=user_optimizer, aw_modifier=modifier)
  File "/home/hjchen/anaconda3/envs/tf1.8/lib/python3.6/site-packages/simple_nn-20.2-py3.6-linux-x86_64.egg/simple_nn/models/neural_network.py", line 745, in train
    self._get_loss()
  File "/home/hjchen/anaconda3/envs/tf1.8/lib/python3.6/site-packages/simple_nn-20.2-py3.6-linux-x86_64.egg/simple_nn/models/neural_network.py", line 337, in _get_loss
    self.str_e_loss = tf.unsorted_segment_mean(self.e_loss, self.next_elem['struct_ind'], tf.size(self.next_elem['struct_type_set']))
  File "/home/hjchen/anaconda3/envs/tf1.8/lib/python3.6/site-packages/tensorflow/python/ops/math_ops.py", line 2656, in unsorted_segment_mean
    N = _unsorted_segment_N(data, segment_ids, num_segments)
  File "/home/hjchen/anaconda3/envs/tf1.8/lib/python3.6/site-packages/tensorflow/python/ops/math_ops.py", line 2620, in _unsorted_segment_N
    ones_tensor = array_ops.ones(segment_ids.shape, dtype=data.dtype)
  File "/home/hjchen/anaconda3/envs/tf1.8/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 1760, in ones
    shape = ops.convert_to_tensor(shape, dtype=dtypes.int32)
  File "/home/hjchen/anaconda3/envs/tf1.8/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1014, in convert_to_tensor
    as_ref=False)
  File "/home/hjchen/anaconda3/envs/tf1.8/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1104, in internal_convert_to_tensor
    ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
  File "/home/hjchen/anaconda3/envs/tf1.8/lib/python3.6/site-packages/tensorflow/python/framework/constant_op.py", line 256, in _tensor_shape_tensor_conversion_function
    "Cannot convert a partially known TensorShape to a Tensor: %s" % s)
ValueError: Cannot convert a partially known TensorShape to a Tensor: (?,)

Then, I print self.next_elemself.next_elem['struct_type_set']and tf.size(self.next_elem['struct_type_set'])

self.next_elem =  {'E': <tf.Tensor 'IteratorGetNext:0' shape=(?, ?) dtype=float64>, 'tot_num': <tf.Tensor 'IteratorGetNext:13' shape=(?, ?) dtype=float64>, 'partition': <tf.Tensor 'Reshape:0' shape=(?,) dtype=int32>, 'struct_type': <tf.Tensor 'IteratorGetNext:11' shape=(?, ?) dtype=string>, 'struct_weight': <tf.Tensor 'IteratorGetNext:12' shape=(?, ?) dtype=float64>, 'pickle_name': <tf.Tensor 'IteratorGetNext:10' shape=(?, ?) dtype=string>, 'atom_idx': <tf.Tensor 'DynamicPartition_2:1' shape=(?, 1) dtype=int32>, 'N_Si': <tf.Tensor 'IteratorGetNext:3' shape=(?, ?) dtype=int64>, 'x_Si': <tf.Tensor 'truediv:0' shape=(?, 70) dtype=float64>, 'dx_Si': <tf.Tensor 'truediv_1:0' shape=(?, 70, ?, ?) dtype=float64>, 'partition_Si': <tf.Tensor 'cond/Merge:0' shape=(?,) dtype=int32>, 'N_O': <tf.Tensor 'IteratorGetNext:2' shape=(?, ?) dtype=int64>, 'x_O': <tf.Tensor 'truediv_2:0' shape=(?, 70) dtype=float64>, 'dx_O': <tf.Tensor 'truediv_3:0' shape=(?, 70, ?, ?) dtype=float64>, 'partition_O': <tf.Tensor 'cond_6/Merge:0' shape=(?,) dtype=int32>, 'F': <tf.Tensor 'DynamicPartition_1:1' shape=(?, 3) dtype=float64>, 'num_seg': <tf.Tensor 'add_1:0' shape=() dtype=int32>, 'sparse_indices_': <tf.Tensor 'Cast_1:0' shape=(?,) dtype=int32>, 'seg_id_': <tf.Tensor 'DynamicPartition:1' shape=(?,) dtype=int32>, 'struct_type_set': <tf.Tensor 'UniqueWithCounts_1:0' shape=(?,) dtype=string>, 'struct_ind': <tf.Tensor 'UniqueWithCounts_1:1' shape=(?,) dtype=int32>, 'struct_N': <tf.Tensor 'UniqueWithCounts_1:2' shape=(?,) dtype=int32>, 'seg_id_Si': <tf.Tensor 'cond_4/Merge:0' shape=(?,) dtype=int32>, 'sparse_indices_Si': <tf.Tensor 'Cast_2:0' shape=(?,) dtype=int32>, 'seg_id_O': <tf.Tensor 'cond_10/Merge:0' shape=(?,) dtype=int32>, 'sparse_indices_O': <tf.Tensor 'Cast_3:0' shape=(?,) dtype=int32>}

self.next_elem['struct_type_set'] =  Tensor("UniqueWithCounts_1:0", shape=(?,), dtype=string)

tf.size(self.next_elem['struct_type_set']) =  Tensor("Size:0", shape=(), dtype=int32)
  • examples/SiO2/error_check/run.py
Traceback (most recent call last):
  File "run.py", line 6, in <module>
    model.run()
  File "/home/hjchen/anaconda3/envs/tf1.8/lib/python3.6/site-packages/simple_nn-20.2-py3.6-linux-x86_64.egg/simple_nn/__init__.py", line 197, in run
    self.model.train(user_optimizer=user_optimizer, aw_modifier=modifier)
  File "/home/hjchen/anaconda3/envs/tf1.8/lib/python3.6/site-packages/simple_nn-20.2-py3.6-linux-x86_64.egg/simple_nn/models/neural_network.py", line 745, in train
    self._get_loss()
  File "/home/hjchen/anaconda3/envs/tf1.8/lib/python3.6/site-packages/simple_nn-20.2-py3.6-linux-x86_64.egg/simple_nn/models/neural_network.py", line 337, in _get_loss
    self.str_e_loss = tf.unsorted_segment_mean(self.e_loss, self.next_elem['struct_ind'], tf.size(self.next_elem['struct_type_set']))
  File "/home/hjchen/anaconda3/envs/tf1.8/lib/python3.6/site-packages/tensorflow/python/ops/math_ops.py", line 2656, in unsorted_segment_mean
    N = _unsorted_segment_N(data, segment_ids, num_segments)
  File "/home/hjchen/anaconda3/envs/tf1.8/lib/python3.6/site-packages/tensorflow/python/ops/math_ops.py", line 2620, in _unsorted_segment_N
    ones_tensor = array_ops.ones(segment_ids.shape, dtype=data.dtype)
  File "/home/hjchen/anaconda3/envs/tf1.8/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 1760, in ones
    shape = ops.convert_to_tensor(shape, dtype=dtypes.int32)
  File "/home/hjchen/anaconda3/envs/tf1.8/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1014, in convert_to_tensor
    as_ref=False)
  File "/home/hjchen/anaconda3/envs/tf1.8/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1104, in internal_convert_to_tensor
    ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
  File "/home/hjchen/anaconda3/envs/tf1.8/lib/python3.6/site-packages/tensorflow/python/framework/constant_op.py", line 256, in _tensor_shape_tensor_conversion_function
    "Cannot convert a partially known TensorShape to a Tensor: %s" % s)
ValueError: Cannot convert a partially known TensorShape to a Tensor: (?,)

Hope to get your reply, Sincerely !

can not install simple-nn with pip

pip install simple-nn
Collecting simple-nn
ERROR: Could not find a version that satisfies the requirement simple-nn (from versions: none)
ERROR: No matching distribution found for simple-nn


pip --version
pip 19.2.3 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)

TypeError: read_vasp_out() got an unexpected keyword argument 'force_consistent'

This project is very helpful to me. But when I run the run.py script(I have installed tensorflow, mpi4py and run the setup.py), there is always show me this error,

WARNING:tensorflow:From C:\Users\Administrator\Anaconda3\envs\tf\lib\site-packages\tensorflow\python\framework\op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
C:\Users\Administrator\Anaconda3\envs\tf\lib\site-packages\simple_nn-0.9.0-py3.6-win-amd64.egg\simple_nn_init_.py:86: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
self.inputs = deep_update(self.inputs, yaml.load(input_file), warn_new_key=True,
Traceback (most recent call last):
File "run.py", line 6, in
model.run()
File "C:\Users\Administrator\Anaconda3\envs\tf\lib\site-packages\simple_nn-0.9.0-py3.6-win-amd64.egg\simple_nn_init_.py", line 172, in run
self.descriptor.generate()
File "C:\Users\Administrator\Anaconda3\envs\tf\lib\site-packages\simple_nn-0.9.0-py3.6-win-amd64.egg\simple_nn\features\symmetry_function_init_.py", line 507, in generate
snapshots = io.read(tmp_name, index=index, format=self.inputs['refdata_format'], force_consistent=True)
File "C:\Users\Administrator\Anaconda3\envs\tf\lib\site-packages\ase-3.18.0-py3.6.egg\ase\io\formats.py", line 495, in read
**kwargs))
File "C:\Users\Administrator\Anaconda3\envs\tf\lib\site-packages\ase-3.18.0-py3.6.egg\ase\io\formats.py", line 556, in iread
for dct in io.read(fd, *args, **kwargs):
File "C:\Users\Administrator\Anaconda3\envs\tf\lib\site-packages\ase-3.18.0-py3.6.egg\ase\io\formats.py", line 354, in wrap_read_function
for atoms in read(filename, index, **kwargs):
File "C:\Users\Administrator\Anaconda3\envs\tf\lib\site-packages\ase-3.18.0-py3.6.egg\ase\utils_init
.py", line 403, in iofunc
obj = func(fd, *args, **kwargs)
TypeError: read_vasp_out() got an unexpected keyword argument 'force_consistent'

I am not familiar with ase. And if i delete this option in the file"C:\Users\Administrator\Anaconda3\envs\tf\lib\site-packages\simple_nn-0.9.0-py3.6-win-amd64.egg\simple_nn\features\symmetry_function_init_.py", when I run this script again, it will show me another error :

WARNING:tensorflow:From C:\Users\Administrator\Anaconda3\envs\tf\lib\site-packages\tensorflow\python\framework\op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
C:\Users\Administrator\Anaconda3\envs\tf\lib\site-packages\simple_nn-0.9.0-py3.6-win-amd64.egg\simple_nn_init_.py:86: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
self.inputs = deep_update(self.inputs, yaml.load(input_file), warn_new_key=True,
Traceback (most recent call last):
File "run.py", line 6, in
model.run()
File "C:\Users\Administrator\Anaconda3\envs\tf\lib\site-packages\simple_nn-0.9.0-py3.6-win-amd64.egg\simple_nn_init_.py", line 172, in run
self.descriptor.generate()
File "C:\Users\Administrator\Anaconda3\envs\tf\lib\site-packages\simple_nn-0.9.0-py3.6-win-amd64.egg\simple_nn\features\symmetry_function_init_.py", line 507, in generate
snapshots = io.read(tmp_name, index=index, format=self.inputs['refdata_format'])
File "C:\Users\Administrator\Anaconda3\envs\tf\lib\site-packages\ase-3.18.0-py3.6.egg\ase\io\formats.py", line 495, in read
**kwargs))
File "C:\Users\Administrator\Anaconda3\envs\tf\lib\site-packages\ase-3.18.0-py3.6.egg\ase\io\formats.py", line 556, in iread
for dct in io.read(fd, *args, **kwargs):
File "C:\Users\Administrator\Anaconda3\envs\tf\lib\site-packages\ase-3.18.0-py3.6.egg\ase\io\formats.py", line 354, in wrap_read_function
for atoms in read(filename, index, **kwargs):
File "C:\Users\Administrator\Anaconda3\envs\tf\lib\site-packages\ase-3.18.0-py3.6.egg\ase\utils_init
.py", line 403, in iofunc
obj = func(fd, *args, **kwargs)
File "C:\Users\Administrator\Anaconda3\envs\tf\lib\site-packages\ase-3.18.0-py3.6.egg\ase\io\vasp.py", line 515, in read_vasp_out
return list(g)
File "C:\Users\Administrator\Anaconda3\envs\tf\lib\site-packages\ase-3.18.0-py3.6.egg\ase\io\utils.py", line 247, in call
for chunk in self._getslice(fd, index):
File "C:\Users\Administrator\Anaconda3\envs\tf\lib\site-packages\ase-3.18.0-py3.6.egg\ase\io\vasp.py", line 477, in outcarchunks
header_data = _read_outcar_header(fd)
File "C:\Users\Administrator\Anaconda3\envs\tf\lib\site-packages\ase-3.18.0-py3.6.egg\ase\io\vasp.py", line 472, in _read_outcar_header
raise IOError('Incomplete OUTCAR')
OSError: Incomplete OUTCAR

How can I deal with these two problems?

Use of E_loss and F_loss

Can you help me understand what E_loss and F_loss mean in the code? I tried to go though the documentation but could not find what exactly the function of these two parameters in the yaml file.

No GPU usage in generate_NNP

I'm trying to run the example in SiO2/generate_NNP using tensorflow GPU in a workstation with 4 Tesla P100 managed by slurm.

To use SIMPLE-NN, I've installed mpi4py and then ran the python setup.py install in a clean conda environment with Python 3.7.
This procedure installed tensorflow 1.15.* automatically through pip.

I had an error with ase which I solved downgrading ase to version 3.18.2 with pip.

To run the example, I've loaded the cuda-10.1.243 module and cudnn-7.6.5.32-10.1 modules, my conda environment, requested 2 gpus with slurm and ran python run.py.
However, when I run nvidia-smi to check the GPU usage, I see that the job is not using the GPU at all.

Is there anything else I need to do to enable the GPU?

Thanks!

Reference data 'utf-8' codec error

I have my reference data as a ASE trajectory file. When I am trying to point to the file in str_list file and running my training I get the following error:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcb in position 32: invalid continuation byte

my str_list file looks like this: PATH/all_train.traj :

I think the problem is with reading the traj file. I tried to convert it into a xyz traj, but I don't think that is supported. How can I solve this issue?

The example can not run normally

After I successfully install the software (Finished processing dependencies for simple-nn==0.9.0), I run the example and always got the following error:TypeError: read_vasp_out() got an unexpected keyword argument ‘force_consistent’. Attached please find the detailed information. Thanks.
simpleNN-test
-test.png

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.