FLSAlg opened a new issue #20223:
URL: https://github.com/apache/incubator-mxnet/issues/20223


   ## Description
   if npx.set_np() sets numpy-array semantics  on then RandomRotation will not 
work
   
   ### Error Message
    File "C:\Users\.....\venv\lib\site-packages\mxnet\gluon\block.py", line 
682, in __call__
       out = self.forward(*args)
     File 
"C:\Users\.......\venv\lib\site-packages\mxnet\gluon\data\vision\transforms.py",
 line 269, in forward
       raise TypeError("This transformation only supports float32. "
   TypeError: This transformation only supports float32. Consider calling it 
after ToTensor
   
   ## To Reproduce
               from mxnet import npx
               npx.set_np()   # without this (or with npx.reset_np()) there is 
no problem
   
               img = mx.image.imread("image.png")
               img_t = transforms.ToTensor()(img)
               rotation = transforms.RandomRotation((5, 6), True, False)  
               img_rt = rotation(img_t)  # this generates the error
   
   ### Steps to reproduce
   1. Run the code snippet above
   
   
   ## What have you tried to solve it?
   I suspect there are more transforms with this problem - dont have time to 
search and catalog all appearnces.
   My work around is to deactivate np semantics with  npx.reset_np() before 
calling functions from transforms and then reactivate with npx.set_np() 
afterwards (the problem appears in a large project)
   
   ## Environment
   mxnet 1.7.0.post2
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to