mxnet-yolo icon indicating copy to clipboard operation
mxnet-yolo copied to clipboard

module 'mxnet.symbol' has no attribute 'stack_neighbor'

Open Heidisnaps opened this issue 8 years ago • 13 comments

Hi. I have some error.

module 'mxnet.symbol' has no attribute 'stack_neighbor'

this is my flow:

$ git clone https://github.com/zhreshold/mxnet-yolo.git
>> (omit)
$ cd mxnet-yolo
~mxnet-yolo$ git clone --recursive https://github.com/dmlc/mxnet
>> (omit)
~mxnet-yolo$ cd mxnet; 
~mxnet-yolo/mxnet$ make -j4
>> (omit)
~mxnet-yolo/mxnet$ git submodule update --recursive --init
~mxnet-yolo/mxnet$ cd ..

after build mxnet, I tried run demo.py

~mxnet-yolo$ python demo.py
Traceback (most recent call last):
  File "demo.py", line 100, in <module>
    ctx, args.nms_thresh, args.force_nms)
  File "demo.py", line 41, in get_detector
    .get_symbol(len(CLASSES), nms_thresh, force_nms)
  File "/home/ubuntu/Notebooks/heidi/test_project/mxdir/mxnet-yolo/symbol/symbol_darknet19_yolo.py", line 25, in get_symbol
    conv5_6 = mx.sym.stack_neighbor(data=conv5_5, kernel=(2, 2), name='stack_downsample')
AttributeError: module 'mxnet.symbol' has no attribute 'stack_neighbor'

so I have done your solution(git submodule update --recursive --init) again in the mxnet-yolo directory.

~mxnet-yolo$ git submodule update --recursive --init
fatal: reference is not a tree: 37455ca2b2c19ff88b3d1a3075a02a4f49db9dd6
Unable to checkout '37455ca2b2c19ff88b3d1a3075a02a4f49db9dd6' in submodule path 'mxnet'

Heidisnaps avatar Aug 10 '17 01:08 Heidisnaps

I have similar issue like below, pls advise, thanks! mxnet-yolo$ git fetch --recurse-submodules Fetching submodule mxnet Fetching submodule mxnet/cub Fetching submodule mxnet/dlpack Fetching submodule mxnet/dmlc-core Fetching submodule mxnet/mshadow Fetching submodule mxnet/nnvm Fetching submodule mxnet/nnvm/dmlc-core Fetching submodule mxnet/nnvm/plugin/nnvm-fusion Fetching submodule mxnet/ps-lite

mxnet-yolo$ git submodule update --recursive --init error: no such remote ref 37455ca2b2c19ff88b3d1a3075a02a4f49db9dd6 Fetched in submodule path 'mxnet', but it did not contain 37455ca2b2c19ff88b3d1a3075a02a4f49db9dd6. Direct fetching of that commit failed.

jianglong98 avatar Aug 24 '17 17:08 jianglong98

mxnet-yolo$ python demo.py --cpu Traceback (most recent call last): File "demo.py", line 2, in import tools.find_mxnet File "/Users/jianglong/Project_ODS/mxnet-yolo/tools/find_mxnet.py", line 7, in import mxnet as mx File "/Users/jianglong/Project_ODS/mxnet-yolo/tools/../mxnet/python/mxnet/init.py", line 25, in from .base import MXNetError File "/Users/jianglong/Project_ODS/mxnet-yolo/tools/../mxnet/python/mxnet/base.py", line 110, in _LIB = _load_lib() File "/Users/jianglong/Project_ODS/mxnet-yolo/tools/../mxnet/python/mxnet/base.py", line 101, in _load_lib lib_path = libinfo.find_lib_path() File "/Users/jianglong/Project_ODS/mxnet-yolo/tools/../mxnet/python/mxnet/libinfo.py", line 59, in find_lib_path 'List of candidates:\n' + str('\n'.join(dll_path))) RuntimeError: Cannot find the files. List of candidates: /Users/jianglong/Project_ODS/mxnet-yolo/mxnet/python/mxnet/libmxnet.dylib /Users/jianglong/Project_ODS/mxnet-yolo/mxnet/python/mxnet/../../lib/libmxnet.dylib /Users/jianglong/Project_ODS/mxnet-yolo/mxnet/python/mxnet/../../build/Release/libmxnet.dylib /Users/jianglong/Project_ODS/mxnet-yolo/mxnet/python/mxnet/libmxnet.so /Users/jianglong/Project_ODS/mxnet-yolo/mxnet/python/mxnet/../../lib/libmxnet.so /Users/jianglong/Project_ODS/mxnet-yolo/mxnet/python/mxnet/../../build/Release/libmxnet.so

jianglong98 avatar Aug 24 '17 17:08 jianglong98

use

git clone --recursive https://github.com/zhreshold/mxnet-yolo
cd mxnet-yolo/mxnet
# try to build it using the official installation tutorial

don't trick submodule from offical repo

zhreshold avatar Aug 24 '17 17:08 zhreshold

Thanks, Zhreshold! How to build mxnet using official installation tutorial? Actually I want to know which mode need to follow: Pip, Docker or virtualenv? I have installed mxnet before this project.

jianglong98 avatar Aug 24 '17 18:08 jianglong98

mxnet$ pwd /Users/jianglong/Project_ODS/mxnet-yolo/mxnet mxnet$ pip install mxnet Requirement already satisfied: mxnet in /Users/jianglong/anaconda/lib/python2.7/site-packages Requirement already satisfied: numpy in /usr/local/lib/python2.7/site-packages (from mxnet)

jianglong98 avatar Aug 24 '17 19:08 jianglong98

@jianglong98 You have to build from source, as I have mentioned the official repo is lacking some operators, pip, docker won't work at all.

zhreshold avatar Aug 24 '17 19:08 zhreshold

I build up mxnet from source, but still have issue below when: 1: the import tools.find_mxnet is in the demo.py, the demo.py was executed and result is the same as before.

2: the import tools.find_mxnet was commented out, then execute result is below: /Users/jianglong/anaconda/bin/python /Users/jianglong/Project_ODS/mxnet-yolo/demo.py Traceback (most recent call last): File "/Users/jianglong/Project_ODS/mxnet-yolo/demo.py", line 100, in ctx, args.nms_thresh, args.force_nms) File "/Users/jianglong/Project_ODS/mxnet-yolo/demo.py", line 41, in get_detector .get_symbol(len(CLASSES), nms_thresh, force_nms) File "/Users/jianglong/Project_ODS/mxnet-yolo/symbol/symbol_darknet19_yolo.py", line 30, in get_symbol conv5_6 = mx.sym.stack_neighbor(data=conv5_5, kernel=(2, 2), name='stack_downsample') AttributeError: 'module' object has no attribute 'stack_neighbor'

jianglong98 avatar Aug 24 '17 19:08 jianglong98

After review find_mxnet.py, I changed the mxnet0 into mxnet in 2nd line, is that useful? import mxnet0 as mx

jianglong98 avatar Aug 24 '17 21:08 jianglong98

git clone --recursive https://github.com/zhreshold/mxnet-yolo cd mxnet-yolo/mxnet # try to build it using the official installation tutorial

You might want to put this on the front page README before the spot where people are sent to the "Instructions" link which tells them to download the official mxnet.

tlc avatar Sep 19 '17 21:09 tlc

I flowed http://mxnet.incubator.apache.org/get_started/windows_setup.html, build x64 gpu version, and python interface. Last run demo.py,and it was still failed !!! conv5_6 = mx.sym.stack_neighbor(data=conv5_5, kernel=(2, 2), name='stack_downsample') AttributeError: module 'mxnet.symbol' has no attribute 'stack_neighbor'

(C:\Anaconda3) E:\dl\lib\mxnet\incubator-mxnet\python>conda info Current conda install: platform : win-64 conda version : 4.3.27 python version : 3.5.2.final.0

(C:\Anaconda3) E:\dl\lib\mxnet\incubator-mxnet\python>conda list mxnet packages in environment at C:\Anaconda3: mxnet 0.12.0

blakeliu avatar Oct 24 '17 02:10 blakeliu

You need to uninstall mxnet. Then build and install the mxnet from the mxnet dir of this project. Not the main project.

Sent from my iPhone

On Oct 23, 2017, at 7:43 PM, blakeliu [email protected] wrote:

I flowed http://mxnet.incubator.apache.org/get_started/windows_setup.html, build x64 gpu version, and python interface. Last run demo.py,and it was still failed !!! conv5_6 = mx.sym.stack_neighbor(data=conv5_5, kernel=(2, 2), name='stack_downsample') AttributeError: module 'mxnet.symbol' has no attribute 'stack_neighbor'

(C:\Anaconda3) E:\dl\lib\mxnet\incubator-mxnet\python>conda info Current conda install: platform : win-64 conda version : 4.3.27 python version : 3.5.2.final.0

(C:\Anaconda3) E:\dl\lib\mxnet\incubator-mxnet\python>conda list mxnet

packages in environment at C:\Anaconda3:

mxnet 0.12.0

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

CptnKirk avatar Oct 24 '17 03:10 CptnKirk

win10 vs2015 build x64 gpu version ,error: e:\cv\object_detection\yolo\mxnet-yolo\mxnet\src\operator\contrib./yolo_output-inl.h(61): error C2398: 元素“1”: 从“double”转换到“float”需要收缩转换 3> 3>e:\cv\object_detection\yolo\mxnet-yolo\mxnet\src\operator\contrib./yolo_output-inl.h(61): error C2398: 元素“2”: 从“double”转换到“float”需要收缩转换

blakeliu avatar Oct 24 '17 03:10 blakeliu

I uninstall official mxnet.And install this by

cd mxnet-yolo/mxnet/python
python setup.py install

on win10.Then run demo.py,it still shows that

module 'mxnet.symbol' has no attribute 'stack_neighbor'

Anyone can tell me what's wrong? And I open symbol.py.It doesn't contain something like 'def stack_neighbor(...,...,...):...' I just find ' stack_neighbor' in 'mxnet-yolo\mxnet\src\operator\tensor\matrix_op.cc'.

euraka71 avatar Dec 26 '17 12:12 euraka71