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

Anaconda Environment for interpreter.py #85

Open
mayor-slash opened this issue Jun 21, 2024 · 0 comments
Open

Anaconda Environment for interpreter.py #85

mayor-slash opened this issue Jun 21, 2024 · 0 comments

Comments

@mayor-slash
Copy link

Hello,
I am trying to convert my own mechanisms to the required npz file.
With my current setup i can't manage to to this.
python interpreter.py -i h2o2.yaml

C:\Users\neuma\anaconda3\envs\reac-env\Lib\site-packages\torch\__init__.py:749: UserWarning: torch.set_default_tensor_type() is deprecated as of PyTorch 2.1, please use torch.set_default_dtype() and torch.set_default_device() as alternatives. (Triggered internally at ..\torch\csrc\tensor\python_tensor.cpp:433.)
  _C._set_default_tensor_type(t)
Processing mechanism h2o2.yaml
C:\Users\neuma\anaconda3\envs\reac-env\Lib\site-packages\reactorch\solution.py:76: UserWarning: Creating a tensor from a list of numpy.ndarrays is extremely slow. Please consider converting the list to a single numpy.ndarray with numpy.array() before converting to a tensor. (Triggered internally at ..\torch\csrc\utils\tensor_new.cpp:277.)
  self.molecular_weights = torch.Tensor([self.gas.molecular_weights]).T.to(self.device)
Traceback (most recent call last):
  File "C:\Users\neuma\Documents\Arrhenius\interpreter.py", line 39, in <module>
    sol = rt.Solution(mech_yaml=mech_yaml, device=torch.device('cpu'),
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\neuma\anaconda3\envs\reac-env\Lib\site-packages\reactorch\solution.py", line 88, in __init__
    self.set_reactions()
  File "C:\Users\neuma\anaconda3\envs\reac-env\Lib\site-packages\reactorch\import_kinetics.py", line 77, in set_reactions
    self.reaction[i] = {'equation': self.gas.reaction_equations(i)}
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "build\\python\\cantera\\kinetics.pyx", line 240, in cantera.kinetics.Kinetics.reaction_equations
TypeError: 'int' object is not iterable

My guess is that my cantera/pytorch/reactorch version is uncompatible. I would want to avoid modifying the interpreter.py script. If you could provide me with a requirement.txt to duplicate your environments, that would be great.

conda list of my current environment yields:

packages in environment at C:\Users\neuma\anaconda3\envs\reac-env:

Name                    Version                   Build  Channel
blas                      1.0                         mkl
bzip2                     1.0.8                h2bbff1b_6
ca-certificates           2024.3.11            haa95532_0
cantera                   3.0.0           py311h859585b_1    cantera
contourpy                 1.2.1                    pypi_0    pypi
cycler                    0.12.1                   pypi_0    pypi
filelock                  3.15.1                   pypi_0    pypi
fonttools                 4.53.0                   pypi_0    pypi
fsspec                    2024.6.0                 pypi_0    pypi
hdf5                      1.12.1               h51c971a_3
icc_rt                    2022.1.0             h6049295_2
intel-openmp              2021.4.0                 pypi_0    pypi
jinja2                    3.1.4                    pypi_0    pypi
kiwisolver                1.4.5                    pypi_0    pypi
libcantera                3.0.0                h82bb817_1    cantera
libffi                    3.4.4                hd77b12b_1
markupsafe                2.1.5                    pypi_0    pypi
matplotlib                3.9.0                    pypi_0    pypi
mkl                       2021.4.0                 pypi_0    pypi
mkl-service               2.4.0           py311h2bbff1b_1
mkl_fft                   1.3.8           py311h2bbff1b_0
mkl_random                1.2.4           py311h59b6b97_0
mpmath                    1.3.0                    pypi_0    pypi
networkx                  3.3                      pypi_0    pypi
numpy                     1.26.4          py311hdab7c0b_0
numpy-base                1.26.4          py311hd01c5d8_0
openssl                   3.0.14               h827c3e9_0
packaging                 24.1                     pypi_0    pypi
pillow                    10.3.0                   pypi_0    pypi
pip                       24.0            py311haa95532_0
pyparsing                 3.1.2                    pypi_0    pypi
python                    3.11.9               he1021f5_0
python-dateutil           2.9.0.post0              pypi_0    pypi
reactorch                 0.1.1                    pypi_0    pypi
ruamel.yaml               0.17.21         py311h2bbff1b_0
scipy                     1.13.1                   pypi_0    pypi
setuptools                69.5.1          py311haa95532_0
six                       1.16.0                   pypi_0    pypi
sqlite                    3.45.3               h2bbff1b_0
sympy                     1.12.1                   pypi_0    pypi
tbb                       2021.12.0                pypi_0    pypi
tk                        8.6.14               h0416ee5_0
torch                     2.3.1+cu118              pypi_0    pypi
torchaudio                2.3.1+cu118              pypi_0    pypi
torchvision               0.18.1+cu118             pypi_0    pypi
typing-extensions         4.12.2                   pypi_0    pypi
tzdata                    2024a                h04d1e81_0
vc                        14.2                 h2eaa2aa_1
vs2015_runtime            14.29.30133          h43f2093_3
wheel                     0.43.0          py311haa95532_0
xz                        5.4.6                h8cc25b3_1
zlib                      1.2.13               h8cc25b3_1
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

No branches or pull requests

1 participant