Commit 4c5d0eb5 authored by Carlos Ungil's avatar Carlos Ungil

missing example image removed, floating traps disabled for Linux/SBCL compatibility

parent 04ebef9d
......@@ -6,7 +6,8 @@
(ql:quickload :drakma)
;; if the following files do not exist they will be retrieved automatically (but not stored)
;; if the data files do not exist in /tmp/ they will be retrieved automatically (but not stored)
;; use the following shell commands to download the files:
#|
cd /tmp/
wget http://data.dmlc.ml/models/imagenet/squeezenet/squeezenet_v1.1-0000.params
......@@ -22,7 +23,7 @@ wget http://data.dmlc.ml/mxnet/models/imagenet/synset.txt
(defun file-as-bytes (path)
(with-open-file (s path :element-type 'unsigned-byte)
(let ((buf (make-array (file-length s) :element-type 'unsigned-byte)))
(let ((buf (make-array (file-length s) :element-type '(unsigned-byte 8))))
(read-sequence buf s)
buf)))
......@@ -70,7 +71,6 @@ wget http://data.dmlc.ml/mxnet/models/imagenet/synset.txt
(defvar *test-images* '("https://upload.wikimedia.org/wikipedia/commons/thumb/b/b8/Blue_cup_of_coffee.svg/500px-Blue_cup_of_coffee.svg.png"
"https://upload.wikimedia.org/wikipedia/commons/thumb/9/92/Sport_car_rim.svg/500px-Sport_car_rim.svg.png"
"https://upload.wikimedia.org/wikipedia/commons/thumb/5/5f/PEO-car.svg/500px-PEO-car.svg.png"
"https://upload.wikimedia.org/wikipedia/commons/thumb/9/9f/Perseus1Hfx.png/480px-Perseus1Hfx.png"
"https://upload.wikimedia.org/wikipedia/commons/7/77/Avatar_cat.png"))
......
(in-package :mxnet.predict.ffi)
;; to regenerate the autowrap definitions, delete or rename the .spec files
;; requires LLVM/Clang and c2ffi https://github.com/rpav/c2ffi
;; ffi/c_predict_api.h and ffi/c_api.h come from include/mxnet in the mxnet sources
(cffi:load-foreign-library "~/mxnet/lib/libmxnet.so")
(autowrap:c-include '(mxnet-predict ffi "c_predict_api.h") :spec-path '(mxnet-predict ffi))
(cl:let ((library (cl:merge-pathnames "mxnet/lib/libmxnet.so" (cl:user-homedir-pathname))))
#+(and linux sbcl) (sb-int:with-float-traps-masked (:invalid :overflow :divide-by-zero)
(cffi:load-foreign-library library))
#-(and linux sbcl) (cffi:load-foreign-library library)
(cl:format cl:t "~%~% Foreign library ~A loaded~%~%~%" library))
(cl:in-package :mxnet.predict.ffi)
(autowrap:c-include '(mxnet-predict ffi "c_predict_api.h") :spec-path '(mxnet-predict ffi))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment