Skip to content

Running thick2d error #1

@nhew1994

Description

@nhew1994

I installed the package using the following steps:

conda create -n thick2d python=3.8
conda activate thick2d
git clone https://github.com/gmp007/THICK2D.git
cd THICK2D
pip install . 
pip install periodictable SMAtool

I tried testing thick2d using the GeSe in the examples folder. Unfortunately, I get the following error:

  File "/storage/work/njh5724/.conda/envs/thick2d/bin/thick2d", line 28, in <module>
    from read_write import read_options_from_input,load_structure,append_data
ImportError: cannot import name 'append_data' from 'read_write' (/storage/work/njh5724/.conda/envs/thick2d/lib/python3.8/site-packages/read_write.py)

If I run using the python script directly in src using python /storage/work/njh5724/THICK2D/src/thick2d, I get the following error:

❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤
❤                                Results using                         ❤
❤                             THICK2D Version: 1.0                     ❤
❤                       VASP code is used as a calculator              ❤
❤                  to perform Deep Neural Network simulations          ❤
❤                Calculations started at 15:56:49 on 2025-08-18        ❤
❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤
ElementFraction: 100%|███████████████████████████████████████████████████████████████████████████████████████████████| 56/56 [00:00<00:00, 494.45it/s]
ValenceOrbital: 100%|████████████████████████████████████████████████████████████████████████████████████████████████| 56/56 [00:00<00:00, 188.03it/s]
Pretrained model does not exist, proceeding with full training...
Training DNN model to predict 2D thickness ...! Be patient ...
Epoch 1/1000
342/344 [============================>.] - ETA: 0s - loss: 1.9780 - mse: 9.2020
Epoch 1: val_loss improved from inf to 1.08405, saving model to /storage/work/njh5724/thick2d_test/GeSe/ml_model/best_thickness_model.keras
Traceback (most recent call last):
  File "/storage/work/njh5724/THICK2D/src/thick2d", line 169, in <module>
    thickness_2D = predict_thickness_2D(atoms, model_directory,num_augmented_samples=num_augmented_samples) #os.getcwd())
  File "/storage/work/njh5724/THICK2D/src/predict_thickness_2D.py", line 126, in predict_thickness_2D
    model_metrics, model = train_and_save_best_model(X_scaled_existing, y_existing, dir_modeldsave, num_augmented_samples, model_type)
  File "/storage/work/njh5724/THICK2D/src/predict_thickness_2D.py", line 330, in train_and_save_best_model
    mdl_history,best_model = model_nn.train(augmented_X_train, augmented_y_train, X_test, y_test, model_checkpoint_path=model_checkpoint_path, early_stopping=early_stopping, epochs=epochs)
  File "/storage/work/njh5724/THICK2D/src/predict_thickness_2D.py", line 774, in train
    mdl_history = self.model.fit(X_train, y_train,
  File "/storage/work/njh5724/.conda/envs/thick2d/lib/python3.8/site-packages/keras/src/utils/traceback_utils.py", line 70, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "/storage/work/njh5724/.conda/envs/thick2d/lib/python3.8/site-packages/keras/src/saving/saving_api.py", line 142, in save_model
    raise ValueError(
ValueError: The following argument(s) are not supported with the native Keras format: ['options']
(thick2d) [njh5724@submit02 GeSe]$

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions