microsoft / CNTK-FastRCNNDetector

A python implementation for a CNTK Fast-RCNN evaluation client
MIT License
21 stars 19 forks source link

Error while running - ValueError: axis(=1) out of bounds #2

Open circularProteus opened 7 years ago

circularProteus commented 7 years ago

I'm having problem using the script in command line; Here the following result:

_(C:\local\Anaconda3-4.1.1-Windows-x86_64\envs\cntk-py35) C:\local\CNTK-2-0-rc3\cntk\Examples\Image\Detection\FastRCNN>python "C:\Users\Ale\Desktop\CNTK-FastRCNNDetector-master\frcnn_detector.py" --input C:\imagetest\1.jpg --model C:\local\CNTK-2-0-rc3\cntk\Examples\Image\Detection\FastRCNN\proc\Grocery100\cntkFiles\Output\Fast-RCNN.model --output C:\output

and the final:


Selected CPU as the process wide default device. Number of images to process: 1 Read file in path: C:\imagetest\1.jpg C:\local\Anaconda3-4.1.1-Windows-x86_64\envs\cntk-py35\lib\site-packages\cntk\core.py:349: UserWarning: your data is of type "float64", but your input variable (uid "Input224") expects "<class 'numpy.float32'>". Please convert your data beforehand to speed up training. (sample.dtype, var.uid, str(var.dtype))) C:\local\Anaconda3-4.1.1-Windows-x86_64\envs\cntk-py35\lib\site-packages\cntk\core.py:349: UserWarning: your data is of type "float64", but your input variable (uid "Input225") expects "<class 'numpy.float32'>". Please convert your data beforehand to speed up training. (sample.dtype, var.uid, str(var.dtype))) Traceback (most recent call last): File "C:\Users\Ale\Desktop\CNTK-FastRCNNDetector-master\frcnn_detector.py", line 361, in rects, labels = detector.detect(img) File "C:\Users\Ale\Desktop\CNTK-FastRCNNDetector-master\frcnn_detector.py", line 277, in detect rois_labels_predictions = np.argmax(rois_values, axis=1) File "C:\local\Anaconda3-4.1.1-Windows-x86_64\envs\cntk-py35\lib\site-packages\numpy\core\fromnumeric.py", line 963, in argmax return _wrapfunc(a, 'argmax', axis=axis, out=out) File "C:\local\Anaconda3-4.1.1-Windows-x86_64\envs\cntk-py35\lib\site-packages\numpy\core\fromnumeric.py", line 57, in _wrapfunc return getattr(obj, method)(*args, kwds) ValueError: axis(=1) out of bounds**

nadavbar commented 7 years ago

Hi @alessi89, thanks for reporting this issue. It was introduced by a change in the CNTK API. I fixed it to use the changed API and the module seems to work now. Let me know if you run into any more issues.

circularProteus commented 7 years ago

ok it works. Thanks