Xilinx / ml-suite

Getting Started with Xilinx ML Suite
https://aws.amazon.com/marketplace/pp/B077FM2JNS
Other
335 stars 152 forks source link

Compiling model fails #78

Open Ygenks opened 5 years ago

Ygenks commented 5 years ago

Hi. I'm trying to compile custom keras resnet50 model using compiler scripts, but they are failing with errors below. Environment: AWS with Xilinx ML Suite AMI.

(ml-suite) [root@ip-172-31-30-17 centos]# python ml-suite/xfdnn/tools/compile/bin/xfdnn_compiler_keras.pyc -n /home/centos/malay/model.hdf5 -g /home/centos/malay/network.cmd <-s all -i 28 -m 4 ..... Traceback (most recent call last): File "./xfdnn/tools/compile/bin/xfdnn_compiler_keras.py", line 151, in File "./xfdnn/tools/compile/bin/xfdnn_compiler_keras.py", line 84, in compile File "./xfdnn/tools/compile/network/keras_tools.py", line 1102, in from_keras_to_fpga_code File "./xfdnn/tools/compile/network/keras_tools.py", line 957, in from_keras_xdd File "./xfdnn/tools/compile/network/keras_tools.py", line 861, in get_pydot_graph_tensor File "./xfdnn/tools/compile/network/keras_tools.py", line 734, in creating_blob_nodes_by_tensor File "./xfdnn/tools/compile/network/tensor_tools.py", line 93, in shape_from_nhwc_to_nchw IndexError: tuple index out of range

I've also tried reference caffe model: (ml-suite) [root@ip-172-31-19-95 centos]# python ml-suite/xfdnn/tools/compile/bin/xfdnn_compiler_caffe.pyc -n malay/resnet50-deploy.prototxt -g malay/resnet50.cmds -w malay/resnet50.caffemodel -s all -i 56 -m 6 ['/home/centos/pickle', '/home/centos/parallel', '/home/centos/bin', '/home/centos/version', '/home/centos/weights', '/home/centos/optimizations', '/home/centos/network', '/home/centos/memory', '/home/centos/graph', '/home/centos/codegeneration', '/home/centos/ml-suite/xfdnn/tools/compile/bin', '/home/centos/ml-suite', '/home/centos/ml-suite/xfdnn/rt', '/home/centos/ml-suite/ext', '/home/centos/ml-suite/models/darknet/tools', '/home/centos/ml-suite/apps/yolo', '/home/centos/ml-suite/apps/yolo/nms', '/home/centos/ml-suite/xfdnn/tools/emu', '/home/centos/ml-suite/xfdnn/tools/compile/network', '/home/centos/ml-suite/xfdnn/tools/compile/graph', '/home/centos/ml-suite/xfdnn/tools/compile/optimizations', '/home/centos/ml-suite/xfdnn/tools/compile/codegeneration', '/home/centos/ml-suite/xfdnn/tools/compile/memory', '/home/centos/ml-suite/xfdnn/tools/compile/version', '/home/centos/ml-suite/xfdnn/tools/compile/weights', '/home/centos/ml-suite/xfdnn/tools/compile/bin', '/home/centos/ml-suite/xfdnn/tools/compile/parallel', '/home/centos/ml-suite/xfmlp/python', '/home/centos/anaconda2/envs/ml-suite/lib/python27.zip', '/home/centos/anaconda2/envs/ml-suite/lib/python2.7', '/home/centos/anaconda2/envs/ml-suite/lib/python2.7/plat-linux2', '/home/centos/anaconda2/envs/ml-suite/lib/python2.7/lib-tk', '/home/centos/anaconda2/envs/ml-suite/lib/python2.7/lib-old', '/home/centos/anaconda2/envs/ml-suite/lib/python2.7/lib-dynload', '/home/centos/anaconda2/envs/ml-suite/lib/python2.7/site-packages', '/home/centos/anaconda2/envs/ml-suite/lib/python2.7/site-packages/pydot_ng-1.0.1.dev0-py2.7.egg'] Traceback (most recent call last): File "./xfdnn/tools/compile/bin/xfdnn_compiler_caffe.py", line 53, in File "/home/centos/anaconda2/envs/ml-suite/lib/python2.7/site-packages/caffe/init.py", line 1, in from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer File "/home/centos/anaconda2/envs/ml-suite/lib/python2.7/site-packages/caffe/pycaffe.py", line 15, in import caffe.io File "/home/centos/anaconda2/envs/ml-suite/lib/python2.7/site-packages/caffe/io.py", line 2, in import skimage.io File "/home/centos/anaconda2/envs/ml-suite/lib/python2.7/site-packages/skimage/init.py", line 167, in from .util.dtype import (img_as_float32, File "/home/centos/anaconda2/envs/ml-suite/lib/python2.7/site-packages/skimage/util/init.py", line 6, in from .apply_parallel import apply_parallel File "/home/centos/anaconda2/envs/ml-suite/lib/python2.7/site-packages/skimage/util/apply_parallel.py", line 8, in import dask.array as da File "/home/centos/anaconda2/envs/ml-suite/lib/python2.7/site-packages/dask/array/init.py", line 9, in from .routines import (take, choose, argwhere, where, coarsen, insert, File "/home/centos/anaconda2/envs/ml-suite/lib/python2.7/site-packages/dask/array/routines.py", line 256, in @wraps(np.matmul) File "/home/centos/anaconda2/envs/ml-suite/lib/python2.7/functools.py", line 33, in update_wrapper setattr(wrapper, attr, getattr(wrapped, attr)) AttributeError: 'numpy.ufunc' object has no attribute 'module'

wilderfield commented 5 years ago

Since we acquired Deephi, we are integrating new front end quantization and compilation tools. So our Keras support is pending an update. Most likely to be addressed within a month.