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

AttributeError: 'Tensor' object has no attribute 'astype' #3

Open
Kaveh8 opened this issue Sep 4, 2021 · 0 comments
Open

AttributeError: 'Tensor' object has no attribute 'astype' #3

Kaveh8 opened this issue Sep 4, 2021 · 0 comments

Comments

@Kaveh8
Copy link

Kaveh8 commented Sep 4, 2021

I have got an error complaining about type of img which is in the transforms.py:11, and it uses .astype. Apparently it considers img as a numpy array, while I have using a .map function for a tfdataset.

I think it should consider to convert input to an expected array (numpy for example).
Or, even better, it should only use tensorflow functions in order to make it useful for graph mode execution, such as when using .map function.

    <ipython-input-10-149e589e978b>:16 get_augmentation  *
        aug_data = aug(**data)
    /opt/conda/lib/python3.7/site-packages/volumentations/core/composition.py:24 __call__  *
        data = tr(force_apply, self.targets, **data)
    /opt/conda/lib/python3.7/site-packages/volumentations/core/transforms_interface.py:50 __call__  *
        data[k] = self.apply(v, **params)
    /opt/conda/lib/python3.7/site-packages/volumentations/augmentations/transforms.py:11 apply  *
        return img.astype(np.float32)

    AttributeError: 'Tensor' object has no attribute 'astype'
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