Skip to content

TypeError: 'numpy.ndarray' object is not callable #48

@ilikebomb

Description

@ilikebomb

Hi, there!
I am using interpreter.py from https://deng-mit.github.io/Arrhenius.jl/dev/get_started/ to generate a .npz input for Arrhenius.jl.
But i encountered with following error in reactorch:

C:\Users\ChaoLW.conda\envs\ct-env\Lib\site-packages\reactorch-0.1.1-py3.12.egg\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 C:\cb\pytorch_1000000000000\work\torch\csrc\utils\tensor_new.cpp:281.)
self.molecular_weights = torch.Tensor([self.gas.molecular_weights]).T.to(self.device)
Traceback (most recent call last):
File "D:\AECCCAE\Projects24\h2flame_dns\cema\CEMA-main\interpreter.py", line 39, in
sol = rt.Solution(mech_yaml=mech_yaml, device=torch.device('cpu'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ChaoLW.conda\envs\ct-env\Lib\site-packages\reactorch-0.1.1-py3.12.egg\reactorch\solution.py", line 88, in init
self.set_reactions()
File "C:\Users\ChaoLW.conda\envs\ct-env\Lib\site-packages\reactorch-0.1.1-py3.12.egg\reactorch\import_kinetics.py", line 38, in set_reactions
self.reactant_stoich_coeffs = torch.Tensor[self.gas.reactant_stoich_coeffs()].to(self.device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'numpy.ndarray' object is not callable

I would like to know any advice for solving this problem, thanks in advance.
Enviroment: Cantera 3.0.1, pytorch 2.5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions