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

Creation of tensor in 3.0.0 results in NonImplementedError #704

Closed
Shashankwer opened this issue May 19, 2020 · 5 comments
Closed

Creation of tensor in 3.0.0 results in NonImplementedError #704

Shashankwer opened this issue May 19, 2020 · 5 comments

Comments

@Shashankwer
Copy link
Contributor

Hi,

For the creation of Tensor in singa 3.0.0 cpu for py36 results in an error as described below:

NotImplementedError: Wrong number or type of arguments for overloaded function 'new_Tensor'.
Possible C/C++ prototypes are:
singa::Tensor::Tensor()
singa::Tensor::Tensor(std::vector< size_t,std::allocator< size_t > > const &,singa::DataType)
singa::Tensor::Tensor(std::vector< size_t,std::allocator< size_t > > const &)
singa::Tensor::Tensor(std::vector< size_t,std::allocator< size_t > > const &,std::shared_ptr< singa::Device >,singa::DataType)
singa::Tensor::Tensor(std::vector< size_t,std::allocator< size_t > > const &,std::shared_ptr< singa::Device >)
singa::Tensor::Tensor(singa::Tensor const &)

The tensor were created from numpy with code implementation as below:

import numpy as np
from singa import tensor

tensor.from_numpy( np.asarray([[1, 0, 0], [0, 1, 0]], dtype=np.float32) )

Following are the operating system specification:

OS: MacOS version 10.15.3
python version: 3.6.10
singa: 3.0.0 cpu_py36

The same code seems to work on singa version 3.0.0.rc1 cpu_py36

@chrishkchris
Copy link
Contributor

could you place the result of "conda list" here?

@chrishkchris
Copy link
Contributor

You may check the anaconda cloud for the existing version available
https://anaconda.org/nusdbsystem/singa-cpu/files

I have run python 3.7 singa 3.0.0 cpu in ubuntu without any problem, you may see the following log:

dcsysh@ncrs:/$ conda create -n singacpu37 python=3.7
Collecting package metadata (current_repodata.json): done
Solving environment: done

==> WARNING: A newer version of conda exists. <==
  current version: 4.8.2
  latest version: 4.8.3

Please update conda by running

    $ conda update -n base -c defaults conda

## Package Plan ##

  environment location: /home/dcsysh/anaconda3/envs/singacpu37

  added / updated specs:
    - python=3.7


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    python_abi-3.7             |          1_cp37m           4 KB  conda-forge
    setuptools-46.4.0          |   py37hc8dfbb8_0         633 KB  conda-forge
    ------------------------------------------------------------
                                           Total:         637 KB

The following NEW packages will be INSTALLED:

  _libgcc_mutex      conda-forge/linux-64::_libgcc_mutex-0.1-conda_forge
  _openmp_mutex      conda-forge/linux-64::_openmp_mutex-4.5-0_gnu
  ca-certificates    conda-forge/linux-64::ca-certificates-2020.4.5.1-hecc5488_0
  certifi            conda-forge/linux-64::certifi-2020.4.5.1-py37hc8dfbb8_0
  ld_impl_linux-64   conda-forge/linux-64::ld_impl_linux-64-2.34-h53a641e_0
  libffi             conda-forge/linux-64::libffi-3.2.1-he1b5a44_1007
  libgcc-ng          conda-forge/linux-64::libgcc-ng-9.2.0-h24d8f2e_2
  libgomp            conda-forge/linux-64::libgomp-9.2.0-h24d8f2e_2
  libstdcxx-ng       conda-forge/linux-64::libstdcxx-ng-9.2.0-hdf63c60_2
  ncurses            conda-forge/linux-64::ncurses-6.1-hf484d3e_1002
  openssl            conda-forge/linux-64::openssl-1.1.1g-h516909a_0
  pip                conda-forge/noarch::pip-20.1-pyh9f0ad1d_0
  python             conda-forge/linux-64::python-3.7.6-h8356626_5_cpython
  python_abi         conda-forge/linux-64::python_abi-3.7-1_cp37m
  readline           conda-forge/linux-64::readline-8.0-hf8c457e_0
  setuptools         conda-forge/linux-64::setuptools-46.4.0-py37hc8dfbb8_0
  sqlite             conda-forge/linux-64::sqlite-3.30.1-hcee41ef_0
  tk                 conda-forge/linux-64::tk-8.6.10-hed695b0_0
  wheel              conda-forge/noarch::wheel-0.34.2-py_1
  xz                 conda-forge/linux-64::xz-5.2.5-h516909a_0
  zlib               conda-forge/linux-64::zlib-1.2.11-h516909a_1006


Proceed ([y]/n)? y


Downloading and Extracting Packages
python_abi-3.7       | 4 KB      | ########################################################################################################################## | 100%
setuptools-46.4.0    | 633 KB    | ########################################################################################################################## | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate singacpu37
#
# To deactivate an active environment, use
#
#     $ conda deactivate

dcsysh@ncrs:/$ source activate singacpu37
(singacpu37) dcsysh@ncrs:/$ conda install -c nusdbsystem -c conda-forge singa-cpu=3.0.0
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.8.2
  latest version: 4.8.3

Please update conda by running

    $ conda update -n base -c defaults conda



## Package Plan ##

  environment location: /home/dcsysh/anaconda3/envs/singacpu37

  added / updated specs:
    - singa-cpu=3.0.0


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    _openmp_mutex-4.5          |           1_llvm           5 KB  conda-forge
    dnnl-1.1                   |            build         3.6 MB  nusdbsystem
    future-0.18.2              |   py37hc8dfbb8_1         712 KB  conda-forge
    libblas-3.8.0              |      16_openblas          10 KB  conda-forge
    libcblas-3.8.0             |      16_openblas          10 KB  conda-forge
    liblapack-3.8.0            |      16_openblas          10 KB  conda-forge
    numpy-1.16.5               |   py37h95a1406_0         4.3 MB  conda-forge
    onnx-1.6.0                 |   py37he1b5a44_0         2.9 MB  conda-forge
    pillow-7.1.2               |   py37h718be6c_0         658 KB  conda-forge
    protobuf-3.9.2             |   py37he1b5a44_1         688 KB  conda-forge
    singa-3.0.0                |         cpu_py37        22.4 MB  nusdbsystem
    singa-cpu-3.0.0            |             py37           4 KB  nusdbsystem
    wrapt-1.12.1               |   py37h8f50634_1          46 KB  conda-forge
    ------------------------------------------------------------
                                           Total:        35.3 MB

The following NEW packages will be INSTALLED:

  deprecated         conda-forge/noarch::deprecated-1.2.7-py_0
  dnnl               nusdbsystem/linux-64::dnnl-1.1-build
  freetype           conda-forge/linux-64::freetype-2.10.2-he06d7ca_0
  future             conda-forge/linux-64::future-0.18.2-py37hc8dfbb8_1
  glog               conda-forge/linux-64::glog-0.3.5-hf484d3e_1001
  jpeg               conda-forge/linux-64::jpeg-9c-h14c3975_1001
  libblas            conda-forge/linux-64::libblas-3.8.0-16_openblas
  libcblas           conda-forge/linux-64::libcblas-3.8.0-16_openblas
  libgfortran-ng     conda-forge/linux-64::libgfortran-ng-7.5.0-hdf63c60_6
  liblapack          conda-forge/linux-64::liblapack-3.8.0-16_openblas
  libopenblas        conda-forge/linux-64::libopenblas-0.3.9-h5ec1e0e_0
  libpng             conda-forge/linux-64::libpng-1.6.37-hed695b0_1
  libprotobuf        conda-forge/linux-64::libprotobuf-3.9.2-h8b12597_0
  libtiff            conda-forge/linux-64::libtiff-4.1.0-hc7e4089_6
  libwebp-base       conda-forge/linux-64::libwebp-base-1.1.0-h516909a_3
  llvm-openmp        conda-forge/linux-64::llvm-openmp-10.0.0-hc9558a2_0
  lz4-c              conda-forge/linux-64::lz4-c-1.9.2-he1b5a44_1
  numpy              conda-forge/linux-64::numpy-1.16.5-py37h95a1406_0
  olefile            conda-forge/noarch::olefile-0.46-py_0
  onnx               conda-forge/linux-64::onnx-1.6.0-py37he1b5a44_0
  pillow             conda-forge/linux-64::pillow-7.1.2-py37h718be6c_0
  protobuf           conda-forge/linux-64::protobuf-3.9.2-py37he1b5a44_1
  singa              nusdbsystem/linux-64::singa-3.0.0-cpu_py37
  singa-cpu          nusdbsystem/linux-64::singa-cpu-3.0.0-py37
  six                conda-forge/noarch::six-1.14.0-py_1
  tqdm               conda-forge/noarch::tqdm-4.46.0-pyh9f0ad1d_0
  wrapt              conda-forge/linux-64::wrapt-1.12.1-py37h8f50634_1
  zstd               conda-forge/linux-64::zstd-1.4.4-h6597ccf_3

The following packages will be DOWNGRADED:

  _openmp_mutex                                   4.5-0_gnu --> 4.5-1_llvm


Proceed ([y]/n)? y


Downloading and Extracting Packages
libblas-3.8.0        | 10 KB     | ########################################################################################################################## | 100%
onnx-1.6.0           | 2.9 MB    | ########################################################################################################################## | 100%
singa-3.0.0          | 22.4 MB   | ########################################################################################################################## | 100%
dnnl-1.1             | 3.6 MB    | ########################################################################################################################## | 100%
_openmp_mutex-4.5    | 5 KB      | ########################################################################################################################## | 100%
wrapt-1.12.1         | 46 KB     | ########################################################################################################################## | 100%
pillow-7.1.2         | 658 KB    | ########################################################################################################################## | 100%
protobuf-3.9.2       | 688 KB    | ########################################################################################################################## | 100%
numpy-1.16.5         | 4.3 MB    | ########################################################################################################################## | 100%
libcblas-3.8.0       | 10 KB     | ########################################################################################################################## | 100%
future-0.18.2        | 712 KB    | ########################################################################################################################## | 100%
singa-cpu-3.0.0      | 4 KB      | ########################################################################################################################## | 100%
liblapack-3.8.0      | 10 KB     | ########################################################################################################################## | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(singacpu37) dcsysh@ncrs:/$ python
Python 3.7.6 | packaged by conda-forge | (default, Mar 23 2020, 23:03:20)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> from singa import tensor
>>>
>>> tensor.from_numpy( np.asarray([[1, 0, 0], [0, 1, 0]], dtype=np.float32) )
[[1. 0. 0.]
 [0. 1. 0.]]
>>>

@Shashankwer
Copy link
Contributor Author

Name Version Build Channel
appnope 0.1.0 py36h9f0ad1d_1001 conda-forge
attrs 19.3.0 py_0 conda-forge
backcall 0.1.0 py_0 conda-forge
bleach 3.1.5 pyh9f0ad1d_0 conda-forge
ca-certificates 2020.4.5.1 hecc5488_0 conda-forge
certifi 2020.4.5.1 py36h9f0ad1d_0 conda-forge
dbus 1.13.6 h2f22bb5_0 conda-forge
decorator 4.4.2 py_0 conda-forge
defusedxml 0.6.0 py_0 conda-forge
deprecated 1.2.7 py_0 conda-forge
dnnl 1.1 build nusdbsystem
entrypoints 0.3 py36h9f0ad1d_1001 conda-forge
expat 2.2.9 h4a8c4bd_2 conda-forge
freetype 2.10.2 h8da9a1a_0 conda-forge
future 0.18.2 py36h9f0ad1d_1 conda-forge
gettext 0.19.8.1 h46ab8bc_1002 conda-forge
glib 2.64.2 h577aef8_1 conda-forge
glog 0.3.5 h0a44026_1001 conda-forge
icu 64.2 h6de7cb9_1 conda-forge
importlib-metadata 1.6.0 py36h9f0ad1d_0 conda-forge
importlib_metadata 1.6.0 0 conda-forge
ipykernel 5.2.1 py36h95af2a2_0 conda-forge
ipython 7.14.0 py36h9f0ad1d_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
ipywidgets 7.5.1 py_0 conda-forge
jedi 0.17.0 py36h9f0ad1d_0 conda-forge
jinja2 2.11.2 pyh9f0ad1d_0 conda-forge
jpeg 9c h1de35cc_1001 conda-forge
jsonschema 3.2.0 py36h9f0ad1d_1 conda-forge
jupyter 1.0.0 py_2 conda-forge
jupyter_client 6.1.3 py_0 conda-forge
jupyter_console 6.1.0 py_1 conda-forge
jupyter_core 4.6.3 py36h9f0ad1d_1 conda-forge
krb5 1.17.1 h1752a42_0 conda-forge
libblas 3.8.0 16_openblas conda-forge
libcblas 3.8.0 16_openblas conda-forge
libclang 9.0.1 default_hf57f61e_0 conda-forge
libcxx 10.0.0 h1af66ff_2 conda-forge
libedit 3.1.20170329 hcfe32e1_1001 conda-forge
libffi 3.2.1 h4a8c4bd_1007 conda-forge
libgfortran 4.0.0 2 conda-forge
libiconv 1.15 h0b31af3_1006 conda-forge
liblapack 3.8.0 16_openblas conda-forge
libllvm9 9.0.1 h7475705_1 conda-forge
libopenblas 0.3.9 h3d69b6c_0 conda-forge
libpng 1.6.37 hbbe82c9_1 conda-forge
libpq 12.2 h489d428_1 conda-forge
libprotobuf 3.10.0 hd174df1_0 conda-forge
libsodium 1.0.17 h01d97ff_0 conda-forge
libtiff 4.1.0 h2ae36a8_6 conda-forge
libwebp-base 1.1.0 h0b31af3_3 conda-forge
llvm-openmp 10.0.0 h28b9765_0 conda-forge
lz4-c 1.9.2 h4a8c4bd_1 conda-forge
markupsafe 1.1.1 py36h37b9a7d_1 conda-forge
mistune 0.8.4 py36h37b9a7d_1001 conda-forge
nbconvert 5.6.1 py36h9f0ad1d_1 conda-forge
nbformat 5.0.6 py_0 conda-forge
ncurses 6.1 h0a44026_1002 conda-forge
notebook 6.0.3 py36h9f0ad1d_0 conda-forge
nspr 4.20 h0a44026_1000 conda-forge
nss 3.47 hc0980d9_0 conda-forge
numpy 1.16.5 py36hde6bac1_0 conda-forge
olefile 0.46 py_0 conda-forge
onnx 1.6.0 py36h4a8c4bd_0 conda-forge
openssl 1.1.1g h0b31af3_0 conda-forge
packaging 20.1 py_0 conda-forge
pandoc 2.9.2.1 0 conda-forge
pandocfilters 1.4.2 py_1 conda-forge
parso 0.7.0 pyh9f0ad1d_0 conda-forge
pcre 8.44 h4a8c4bd_0 conda-forge
pexpect 4.8.0 py36h9f0ad1d_1 conda-forge
pickleshare 0.7.5 py36h9f0ad1d_1001 conda-forge
pillow 7.1.2 py36h2ae5dfa_0 conda-forge
pip 20.1 pyh9f0ad1d_0 conda-forge
prometheus_client 0.7.1 py_0 conda-forge
prompt-toolkit 3.0.5 py_0 conda-forge
prompt_toolkit 3.0.5 0 conda-forge
protobuf 3.10.0 py36h4a8c4bd_0 conda-forge
ptyprocess 0.6.0 py_1001 conda-forge
pygments 2.6.1 py_0 conda-forge
pyparsing 2.4.7 pyh9f0ad1d_0 conda-forge
pyqt 5.12.3 py36haa9e2f4_3 conda-forge
pyqt5-sip 4.19.18 pypi_0 pypi
pyqtchart 5.12 pypi_0 pypi
pyqtwebengine 5.12.1 pypi_0 pypi
pyrsistent 0.16.0 py36h37b9a7d_0 conda-forge
python 3.6.10 h4334963_1011_cpython conda-forge
python-dateutil 2.8.1 py_0 conda-forge
python_abi 3.6 1_cp36m conda-forge
pyzmq 19.0.1 py36h820b253_0 conda-forge
qt 5.12.5 h514805e_3 conda-forge
qtconsole 4.7.4 pyh9f0ad1d_0 conda-forge
qtpy 1.9.0 py_0 conda-forge
readline 8.0 hcfe32e1_0 conda-forge
send2trash 1.5.0 py_0 conda-forge
setuptools 46.4.0 py36h9f0ad1d_0 conda-forge
singa 3.0.0 cpu_py36 nusdbsystem
six 1.14.0 py_1 conda-forge
sqlite 3.30.1 h93121df_0 conda-forge
terminado 0.8.3 py36h9f0ad1d_1 conda-forge
testpath 0.4.4 py_0 conda-forge
tk 8.6.10 hbbe82c9_0 conda-forge
tornado 6.0.4 py36h37b9a7d_1 conda-forge
tqdm 4.46.0 pyh9f0ad1d_0 conda-forge
traitlets 4.3.3 py36h9f0ad1d_1 conda-forge
wcwidth 0.1.9 pyh9f0ad1d_0 conda-forge
webencodings 0.5.1 py_1 conda-forge
wheel 0.34.2 py_1 conda-forge
widgetsnbextension 3.5.1 py36_0 conda-forge
wrapt 1.12.1 py36h37b9a7d_1 conda-forge
xz 5.2.5 h0b31af3_0 conda-forge
zeromq 4.3.2 h6de7cb9_2 conda-forge
zipp 3.1.0 py_0 conda-forge
zlib 1.2.11 h0b31af3_1006 conda-forge
zstd 1.4.4 h4b3e974_3 conda-forge

@Shashankwer
Copy link
Contributor Author

Will check the updated version

@Shashankwer
Copy link
Contributor Author

Updating to 3.7, the version seems to working well. Thank you for the assistance.

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

2 participants