MushroomRL / mushroom-rl

Python library for Reinforcement Learning.
MIT License
803 stars 145 forks source link

TypeError: can't convert np.ndarray of type numpy.object_. The only supported types are: float64, float32, float16, complex64, complex128, int64, int32, int16, int8, uint8, and bool. #137

Closed WFKMSX closed 7 months ago

WFKMSX commented 8 months ago

python3.10/site-packages/mushroom_rl/approximators/parametric/torch_approximator.py"

    if not self._use_cuda:
        torch_args = [torch.as_tensor(x) if isinstance(x, np.ndarray) else x
                      for x in args]
        val = self.network(*torch_args, **kwargs)

torch_args = [torch.astensor(x) if isinstance(x, np.ndarray) else x TypeError: can't convert np.ndarray of type numpy.object. The only supported types are: float64, float32, float16, complex64, complex128, int64, int32, int16, int8, uint8, and bool.

boris-il-forte commented 8 months ago

This is not a bug, per se. The behavior and the error are totally fine: you cannot pass an object as an input to the NN. The question is: why are you passing an np.ndarray of type numpy.object_ to the network?

boris-il-forte commented 7 months ago

Closing due to lack of further response on this issue.