gnu: onnx: Change source to 'git-fetch'.
* gnu/packages/machine-learning.scm (onnx)[source]: Change to 'git-fetch'. Add "onnx-skip-model-downloads.patch". [arguments]: Add 'make-test-directory-writable' phase. * gnu/packages/patches/onnx-skip-model-downloads.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it.
parent
fa2d94b5e3
commit
630c39d8df
|
@ -1514,6 +1514,7 @@ dist_patch_DATA = \
|
||||||
%D%/packages/patches/oneko-remove-nonfree-characters.patch \
|
%D%/packages/patches/oneko-remove-nonfree-characters.patch \
|
||||||
%D%/packages/patches/onnx-use-system-googletest.patch \
|
%D%/packages/patches/onnx-use-system-googletest.patch \
|
||||||
%D%/packages/patches/onnx-shared-libraries.patch \
|
%D%/packages/patches/onnx-shared-libraries.patch \
|
||||||
|
%D%/packages/patches/onnx-skip-model-downloads.patch \
|
||||||
%D%/packages/patches/openbabel-fix-crash-on-nwchem-output.patch \
|
%D%/packages/patches/openbabel-fix-crash-on-nwchem-output.patch \
|
||||||
%D%/packages/patches/opencascade-oce-glibc-2.26.patch \
|
%D%/packages/patches/opencascade-oce-glibc-2.26.patch \
|
||||||
%D%/packages/patches/opencv-fix-build-of-grfmt_jpeg2000.cpp.patch \
|
%D%/packages/patches/opencv-fix-build-of-grfmt_jpeg2000.cpp.patch \
|
||||||
|
|
|
@ -585,16 +585,20 @@ in terms of new algorithms.")
|
||||||
(package
|
(package
|
||||||
(name "onnx")
|
(name "onnx")
|
||||||
(version "1.9.0")
|
(version "1.9.0")
|
||||||
(source
|
(source (origin
|
||||||
(origin
|
(method git-fetch)
|
||||||
(method url-fetch)
|
(uri (git-reference
|
||||||
(uri (pypi-uri "onnx" version))
|
(url "https://github.com/onnx/onnx")
|
||||||
(patches (search-patches "onnx-use-system-googletest.patch"
|
(commit (string-append "v" version))))
|
||||||
"onnx-shared-libraries.patch"))
|
(sha256
|
||||||
(sha256
|
(base32
|
||||||
(base32 "0yjv2axz2vc2ysniwislsp53fsb8f61y1warrr2ppn2d9ijml1d9"))
|
"1xnii361f68x0masxgfc4ai7hh3wlxxk56aznwf4m4yr6wqx47ml"))
|
||||||
(modules '((guix build utils)))
|
(file-name (git-file-name name version))
|
||||||
(snippet '(delete-file-recursively "third_party"))))
|
(patches (search-patches "onnx-use-system-googletest.patch"
|
||||||
|
"onnx-shared-libraries.patch"
|
||||||
|
"onnx-skip-model-downloads.patch"))
|
||||||
|
(modules '((guix build utils)))
|
||||||
|
(snippet '(delete-file-recursively "third_party"))))
|
||||||
(build-system python-build-system)
|
(build-system python-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
'(#:phases (modify-phases %standard-phases
|
'(#:phases (modify-phases %standard-phases
|
||||||
|
@ -625,6 +629,13 @@ in terms of new algorithms.")
|
||||||
;; -j'.
|
;; -j'.
|
||||||
(setenv "MAX_JOBS"
|
(setenv "MAX_JOBS"
|
||||||
(number->string (parallel-job-count)))))
|
(number->string (parallel-job-count)))))
|
||||||
|
(add-before 'check 'make-test-directory-writable
|
||||||
|
(lambda _
|
||||||
|
;; Make things writable for tests.
|
||||||
|
(setenv "HOME" (getcwd))
|
||||||
|
(for-each make-file-writable
|
||||||
|
(find-files "onnx/examples" "."
|
||||||
|
#:directories? #t))))
|
||||||
(add-after 'install 'install-from-cmake
|
(add-after 'install 'install-from-cmake
|
||||||
(lambda _
|
(lambda _
|
||||||
;; Run "make install" in the build tree 'setup.py'
|
;; Run "make install" in the build tree 'setup.py'
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
A few tests require downloading models from URLs such as
|
||||||
|
<https://s3.amazonaws.com/download.onnx/models/opset_9/zfnet512.tar.gz>.
|
||||||
|
Skip those.
|
||||||
|
|
||||||
|
diff --git a/onnx/backend/test/runner/__init__.py b/onnx/backend/test/runner/__init__.py
|
||||||
|
index 049ed57b..f236f1bf 100644
|
||||||
|
--- a/onnx/backend/test/runner/__init__.py
|
||||||
|
+++ b/onnx/backend/test/runner/__init__.py
|
||||||
|
@@ -202,6 +202,7 @@ class Runner(object):
|
||||||
|
print('Start downloading model {} from {}'.format(
|
||||||
|
model_test.model_name,
|
||||||
|
model_test.url))
|
||||||
|
+ raise unittest.SkipTest('Skipping download')
|
||||||
|
urlretrieve(model_test.url, download_file.name)
|
||||||
|
print('Done')
|
||||||
|
with tarfile.open(download_file.name) as t:
|
Reference in New Issue