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

use_fast_tensor_data_set breaks during_training_metric #571

Closed
elcorto opened this issue Aug 22, 2024 · 1 comment
Closed

use_fast_tensor_data_set breaks during_training_metric #571

elcorto opened this issue Aug 22, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@elcorto
Copy link
Member

elcorto commented Aug 22, 2024

When adding this

parameters.running.during_training_metric = "band_energy"
parameters.data.use_fast_tensor_data_set = True

to examples/basic/ex01_train_network.py, we get

Traceback (most recent call last):
  File "/path/to/mala/examples/basic/ex01_train_network.py", line 95, in <module>
    test_trainer.train_network()
  File "/path/to/mala/mala/network/trainer.py", line 424, in train_network
    vloss = self.__validate_network(
            ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/mala/mala/network/trainer.py", line 1149, in __validate_network
    self._forward_entire_snapshot(
  File "/path/to/mala/mala/network/runner.py", line 399, in _forward_entire_snapshot
    (data_set[from_index:to_index])[1], as_numpy=True
     ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/mala/mala/datahandling/fast_tensor_dataset.py", line 40, in __getitem__
    idx * self.batch_size : (idx + 1) * self.batch_size
    ~~~~^~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for *: 'slice' and 'int'
@elcorto elcorto added the bug Something isn't working label Aug 22, 2024
@RandomDefaultUser
Copy link
Member

Hi @elcorto I just tested this and while I can reproduce this issue with an older version of this code I no longer see this error with commits starting from #560, which severely overhauled the reporting/validation process. I would close this issue for now, but if this issue arises again or the fast tensor data set behaves differently than expected after these changes feel free to create a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants