Skip to content
This repository was archived by the owner on Oct 15, 2019. It is now read-only.
This repository was archived by the owner on Oct 15, 2019. It is now read-only.

second grad error #165

@kernel8liang

Description

@kernel8liang

Run autograd_tutorial example,

https://github.com/dmlc/minpy/blob/master/examples/tutorials/autograd_tutorial.ipynb

import matplotlib.pyplot as plt
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['image.cmap'] = 'gray'

x = np.linspace(-10, 10, 200)
# plt.plot only takes ndarray as input. Explicitly convert MinPy Array into ndarray.
plt.plot(x.asnumpy(), foo(x).asnumpy(),
         x.asnumpy(), d_foo(x).asnumpy(),
         x.asnumpy(), d_2_foo(x).asnumpy(),
         x.asnumpy(), d_3_foo(x).asnumpy())
plt.show()

error below

AttributeError                            Traceback (most recent call last)
<ipython-input-5-317bda464833> in <module>()
      9 plt.plot(x.asnumpy(), foo(x).asnumpy(),
     10          x.asnumpy(), d_foo(x).asnumpy(),
---> 11          x.asnumpy(), d_2_foo(x).asnumpy(),
     12          x.asnumpy(), d_3_foo(x).asnumpy())
     13 plt.show()

AttributeError: 'float' object has no attribute 'asnumpy'
In [2]: mxnet.__version__
Out[2]: '0.9.4'

minpy version 0.33.

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