Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install_backend() fails with AssertionError #37

Closed
thefiddler opened this issue Oct 25, 2017 · 1 comment
Closed

install_backend() fails with AssertionError #37

thefiddler opened this issue Oct 25, 2017 · 1 comment

Comments

@thefiddler
Copy link

When executing the example code found in the README file, I get the following error:

import plaidml.keras
plaidml.keras.install_backend()

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File~/dev/plaidml/plaidml/keras/__init__.py", line 75, in install_backend
    from keras.utils import conv_utils
  File~/.virtualenvs/plaidml/lib/python3.6/site-packages/keras/__init__.py", line 3, in <module>
    from . import utils
  File~/.virtualenvs/plaidml/lib/python3.6/site-packages/keras/utils/__init__.py", line 6, in <module>
    from . import conv_utils
  File~/.virtualenvs/plaidml/lib/python3.6/site-packages/keras/utils/conv_utils.py", line 3, in <module>
    from .. import backend as K
  File~/.virtualenvs/plaidml/lib/python3.6/site-packages/keras/backend/__init__.py", line 71, in <module>
    assert _backend in {'theano', 'tensorflow', 'cntk'}
AssertionError

I am building plaidml using bazel on MacOS and installing into a virtual environment (which also has keras 2.0.8 installed).

Any ideas?

@brianretford
Copy link

Currently doesn't support python 3. Support is in progress in #25

brianretford pushed a commit that referenced this issue Nov 18, 2017
* T919, T1185: Add macos-10.12 + keras-plaid-ocl-vega to jenkins (#7)

- Add clpeak and clinfo (and build with `//...`)
- Fix analysis bugs
- Add ansible roles to provision mac

* Two unfortunately combined changes:1) Changes to combining elementwise data2) Limit number of in-flight kernels in all case to lower memory use

Summary:
Merge branch 'rob-vgg19' of github.com:vertexai/scratch

Change how we deal with combined elementwise ops and their indexes

Lints...

Merge branch 'master' of github.com:vertexai/main

Reviewers: rob, brian

Subscribers: jenkins

Differential Revision: https://phb.1026labs.com/D1105

* Added some prints to make compilation times not seems so terrible

Reviewers: tim

Reviewed By: tim

Differential Revision: https://phb.1026labs.com/D1110

* Minor x64_windows tweaks

Summary: Fixes T807 (again)

Reviewers: brian

Reviewed By: brian

Subscribers: jenkins

Maniphest Tasks: T807

Differential Revision: https://phb.1026labs.com/D1115

* Add version information to plaidml

Summary: Add version template

Reviewers: rob

Reviewed By: rob

Subscribers: jenkins

Differential Revision: https://phb.1026labs.com/D1114

* Support OpenCL vector datatypes

Summary: Fixes T1172

Reviewers: jeremy

Reviewed By: jeremy

Subscribers: jenkins

Maniphest Tasks: T1172

Differential Revision: https://phb.1026labs.com/D1094

* Track deps by kernel, not by tmp

Reviewers: jeremy

Reviewed By: jeremy

Subscribers: jenkins

Maniphest Tasks: T1187

Differential Revision: https://phb.1026labs.com/D1116

* Add usage metric tracking, rework config

Summary:
Adds support for reporting all devices including ones with no config
Reworks device enumeration
Pushes device selection into plaidml instead of keras
Adds cloud function call to report usage, generates usage reports
Adds 'PLAIDML_STEALTH' option for disabling usage reports

Reviewers: rob, frank

Subscribers: jenkins

Differential Revision: https://phb.1026labs.com/D1117

* Eliminate reshape and ident kernels

Reviewers: jeremy

Reviewed By: jeremy

Subscribers: jenkins

Maniphest Tasks: T1187

Differential Revision: https://phb.1026labs.com/D1122

* Update message and kill log creation

Summary: Merge branch 'master' of github.com:vertexai/main into minor-release-fixes

Reviewers: jeremy, tim, rob

Reviewed By: tim, rob

Subscribers: jenkins, tim

Differential Revision: https://phb.1026labs.com/D1125

* Minor plaidml-setup tweaks

* Remove barking

* Reuse elementwise input buffers for outputs

Reviewers: jeremy

Reviewed By: jeremy

Subscribers: jenkins

Maniphest Tasks: T1187

Differential Revision: https://phb.1026labs.com/D1123

* Possible fix to Mac config issues and some new settings

Reviewers: brian

Reviewed By: brian

Subscribers: jenkins

Differential Revision: https://phb.1026labs.com/D1130

* Merge from public repos. Tidy up messages.

Summary:
Update instructions (#12)

update pb/pv links (#13)

* update pb/pv links

* add requirements.txt documentation

Made requirements less strict

Merge pull request #10 from jbruestle/master

Made requirements less strict

update remotes

Merge commit '2f53a1c275b2c82195f4f597f63364c54a7aa44a'

Merge commit '7c35fcb33274907678bb221e73214b8fe998c1e3'

Integrate open source, fix log messages

minor plaidml setup updates

Reviewers: frank, jeremy

Reviewed By: jeremy

Subscribers: jenkins

Differential Revision: https://phb.1026labs.com/D1127

* Dealias all input/output buffers

Summary: Fixes T1203

Reviewers: jeremy

Reviewed By: jeremy

Subscribers: jenkins

Maniphest Tasks: T1203

Differential Revision: https://phb.1026labs.com/D1132

* Stub out unimplemented Keras backend functions

Summary: Add a stub with a NotImplementedError for each of the unimplemented Keras backend functions.

Reviewers: jeremy

Reviewed By: jeremy

Subscribers: jenkins

Differential Revision: https://phb.1026labs.com/D1131

* Add backwards operation unification

Summary: Fixes T1207

Reviewers: jeremy

Reviewed By: jeremy

Subscribers: jenkins

Maniphest Tasks: T1207

Differential Revision: https://phb.1026labs.com/D1133

* More work on web-based object detection demo

Reviewers: brian

Reviewed By: brian

Subscribers: jenkins

Maniphest Tasks: T1176

Differential Revision: https://phb.1026labs.com/D1135

* Fix and test 1D categorical crossentropy

Summary: Fixes a Tile compile error that would occur if we called `K.categorical_crossentropy` with 1D tensors. Adds an appropriate unit test.

Reviewers: jeremy

Reviewed By: jeremy

Subscribers: jenkins

Differential Revision: https://phb.1026labs.com/D1139

* Vectorization fixes

Summary: Fixes T1208

Reviewers: rob

Reviewed By: rob

Subscribers: jenkins

Maniphest Tasks: T1208

Differential Revision: https://phb.1026labs.com/D1137

* Making regexes match more stuff

* Use program output bufs for intra-program allocs

Reviewers: jeremy

Reviewed By: jeremy

Subscribers: jenkins

Maniphest Tasks: T1187

Differential Revision: https://phb.1026labs.com/D1129

* Emit types for overloadeds; use correct bools

Reviewers: jeremy

Reviewed By: jeremy

Subscribers: jenkins

Maniphest Tasks: T1212

Differential Revision: https://phb.1026labs.com/D1140

* Remove VLOG level from profiling test

Summary: Fixes T1216

Reviewers: brian

Reviewed By: brian

Subscribers: jenkins

Maniphest Tasks: T1216

Differential Revision: https://phb.1026labs.com/D1143

* Pull from public

Reviewers: jeremy, frank

Reviewed By: jeremy, frank

Subscribers: frank, jenkins

Differential Revision: https://phb.1026labs.com/D1141

* Refactor SSD

Summary:
Adjust the network architecture to more closely match that used in the tensorflow example. (Note: This breaks weights saved from previous versions of the architecture.) As part of this, adjust the format of y_true: it now has two parts, and the network has two outputs (a location part and a categorization part). This means adjustments to the SSD utilities and the SSD loss function as well.

Also makes the hyperparameters more closely match those from the paper, including adding an option for weight decay.

Adds test for SSD loss and roundtripping SSD bounding box data.

Reviewers: jeremy

Reviewed By: jeremy

Subscribers: jenkins

Differential Revision: https://phb.1026labs.com/D1145

* Possible fixes for #26

Summary: Merge branch 'master' of github.com:vertexai/main

Reviewers: rob

Reviewed By: rob

Subscribers: brian, jenkins

Differential Revision: https://phb.1026labs.com/D1146

* Pull from public

Summary:
Fix some type errors (#42)

Fix six usage. (#43)

Merge commit '9f517142ccf9d1df13f3712c867cb83375bc4498'

Reviewers: jeremy

Reviewed By: jeremy

Differential Revision: https://phb.1026labs.com/D1147

* Finish python 3 support

Reviewers: jeremy

Reviewed By: jeremy

Subscribers: jenkins

Differential Revision: https://phb.1026labs.com/D1148

* Change to vector size

Reviewers: brian

Reviewed By: brian

Differential Revision: https://phb.1026labs.com/D1152

* Fix subtraction constant types

Summary:
When subtracting a float constant from a tensor, the fconst was cast to an iconst. Fix this to properly retain the type as a float.

Improve +-*/ const tests

Reviewers: jeremy, rob

Reviewed By: jeremy, rob

Subscribers: jenkins, rob

Differential Revision: https://phb.1026labs.com/D1155

* Fix expand_dims shape type

Summary: Keras shapes are supposed to be tuples. The shape of expand_dims output was not. This fixes that.

Reviewers: brian

Reviewed By: brian

Subscribers: jenkins

Differential Revision: https://phb.1026labs.com/D1150

* Add --fp16 to backend_test and fix T1198 (#8)

* Enable float16 mode for keras backend test via '--fp16' argument

Reviewers: tim, frank

Reviewed By: tim

Subscribers: jenkins

Differential Revision: https://phb.1026labs.com/D1119

* Support for running float16

* Fix for T1198

* Remove prepare and package jobs

* Fix build

* Fix missing backend functions

* x64_windows tweaks

Summary:
Fixes T807

Rm -lpthread x64_windows protobuf.BUILD

Use OCL limits for exprtypes

Minor python style fixes

Get updated env vars on win32

Reviewers: brian

Reviewed By: brian

Subscribers: jenkins

Maniphest Tasks: T807

Differential Revision: https://phb.1026labs.com/D1153

* Add Min and Assign aggregation ops

Summary:
Add < (min) and = (assign) aggregation operations to those allowed in contractions. Switch Keras backend to use < and = contractions where appropriate. Make Assign assert that each output entry is assigned to at most once; add a test of this.

Note that the Tile compiler is not very smart in determining multiple assignment for =. Use + or no_defract as appropriate to bypass this.

Fix the spelling of gradient.

Reviewers: jeremy

Reviewed By: jeremy

Differential Revision: https://phb.1026labs.com/D1159

* Add keras-plaid-ocl-gt650m-macos and keras-plaid-ocl-hd4000-macos to jenkins test suite

Reviewers: brian

Reviewed By: brian

Subscribers: jenkins

Maniphest Tasks: T1202

Differential Revision: https://phb.1026labs.com/D1157

* Simplify config situation

Summary:
Merged master

Massive config fix

Reviewers: frank

Reviewed By: frank

Subscribers: jenkins

Differential Revision: https://phb.1026labs.com/D1138

* windows progress

* windows builds

* Windows support

Summary:
initial windows support

fix buildtools install

Merge branch 'master' of github.com:vertexai/main into win

use vault to encrypt passwords

windows progress

pull from windows laptop

windows builds

Merge commit '94dfccf55034a0abdb26bd2f4419d8438a68dbc1' into win

Merge branch 'master' of github.com:vertexai/main into win

make sh work for windows:

Differential Revision: https://phb.1026labs.com/D1162

* work around skylark issue

* use plaidml binary again

* h5py to 2.7

* Partial implementation of slice support, fix to batch flatten and permute

Summary:
Added slice changes to backend

Fixed batch flatten and permute

Merge fix

Fixed lints

Reviewers: tim

Reviewed By: tim

Subscribers: brian, jenkins

Differential Revision: https://phb.1026labs.com/D1161

* Fixes to add platform selector and update experimental config to workaround apple driver issues

Reviewers: brian, rob

Reviewed By: rob

Subscribers: jenkins

Differential Revision: https://phb.1026labs.com/D1164

* Fix K.sum/K.prod/etc over axis 0

Summary: Fix a bug in _compute_agg_axes when using `axis=0`.

Reviewers: jeremy

Reviewed By: jeremy

Subscribers: jenkins

Differential Revision: https://phb.1026labs.com/D1165

* Improve vectorization correctness, applicability, and logging.

Summary:
Make vectorizer correct and more verbose

Unwound temporary change

Typo fix

Lints

More typos

Man, I just can't type today

Reviewers: frank, rob

Reviewed By: frank, rob

Subscribers: jenkins

Differential Revision: https://phb.1026labs.com/D1166

* Fix K.pool error message

Summary: K.pool would crash trying to print an error message when given bad input. Fix that.

Reviewers: frank

Reviewed By: frank

Subscribers: jenkins

Differential Revision: https://phb.1026labs.com/D1167

* unittest tweaks

* Add Tile tutorial support

Summary:
Adds tests for all the operations used in the Tile tutorial, plus adds all the necessary support to properly run those tests.

In particular, this implements dilated convolutions and cumsum.

Also adds a file of tutorial tests, and a sandbox. (Not sure whether we should retain the sandbox -- I'm interested in reviewer feedback on that.)

Reviewers: jeremy

Reviewed By: jeremy

Subscribers: jenkins

Differential Revision: https://phb.1026labs.com/D1168

* Cherry pick changes

* Changes to odroid settings and fix for issue with use_global kernels

* Improvements to embedded support

* Temporarily skip yolo_test on arm
* Add is_synchronous to HardwareSettings since on some platforms, enabling out of order execution causes lockups when profiling is also enabled.
* Refactor HAL interface to allow the Platform to `WaitFor()` a collection of events. Also provide a way to log specific kernel failures so that when a `CL_INVALID_OPERATION` occurs, we can quickly determine which kernel is at fault.

* Configure pre-commit hooks to provide linting (#16)

* fix typos

* Elide kernel outputs that duplicate inputs (#27)

* Elide kernel outputs that duplicate inputs

* Make a general regression test py

* Add regression_test to ci plan

* Remove skip_platform

* Add correct cl_khr_fp64 support

* Complete promises for empty OpenCL events (#33)

* Get jenkins builds to be green again (#37)

* Add support for convert Tensor Flow frozen networks to Keras + Tile (#34)

* Copy TF protos

Copy the protos needed to read a saved graph. Probably should be
doing this as an external dependancy, but that's much more painful,
and this should be short-term ok.

* Begin a tf weight reader

* Rename tf weight parser

* Improve TF weight import

* Handle ssd weights by layer type

* Add comments, add conv property parser

* Initial frozen -> keras converter

* Got some boxes

* Ok, further progress

* Fix case issue on inputs + outputs

* Cleaning up

* Fixed annoying parser issue

* Fixes for Retford

* Fixed missing implied feature

* Fix an error in dropout that was being hidden

* Use shared_ptr for copyable rundown (#39)

* In Keras pool, assume input shape is immutable (#31)

* Pull from public (#44)

* Vertexai updates 20171101 (#24)

* normalize execution time to be per example

* merge

* removed debug code

* altered stopwatches start and stop code positions

* fixed indent and changed call to intial run

* removed extraneous statements

* comment fixes

* removed network arguement for a blanket run

* set execution_duration = execution time / example size

* removed required network argument for a blanket run (#26)

* removed network argument for a blanket run
* set execution_duration = execution time / example size

* added DEBUG flags

* added multi batches to blanket run

* removed debug code

* fixed data storage

* fixed comments

* removed debugging code

* renamed example in dict to model

* correct errors moved data storage statement

* changed default epochs and added blanket testing

* testing travis.yml run

* added mobilenet train test to travis

* removed -q on apt-get update

* fixed raise, removed sleep

* Squashed 'public/plaidml/' changes from bde70ef..937a35c

937a35c Add contribution guidelines and detailed building instructions (#62)
7f3285a vertexai-updates-20171102 (#56)
9f3e1e1 Vertexai updates 20171101 (#55)

git-subtree-dir: public/plaidml
git-subtree-split: 937a35c

* plaidml pull

* Squashed 'public/plaidbench/' changes from 36899f0..6335c29c

6335c29c Merge pull request #28 from plaidml/stacktrace
4c0eb329 fixed raise, removed sleep
ac9859dd removed -q on apt-get update
f60552f1 Merge pull request #27 from plaidml/multibatch
7ade02ce added mobilenet train test to travis
2ddd8b3c testing travis.yml run
1570c78f changed default epochs and added blanket testing
824c7823 correct errors moved data storage statement
19331758 renamed example in dict to model
8843f66f removed debugging code
6b94c803 fixed comments
937fc1fe fixed data storage
8950320c removed debug code
951efaa7 merged master
409044ff added multi batches to blanket run
7f23ca30 added DEBUG flags
3a102e59 removed required network argument for a blanket run (#26)
02acf0f9 set execution_duration = execution time / example size
36e4d4cb removed network arguement for a blanket run
8289a61c Merge pull request #25 from plaidml/merge
129078c0 comment fixes
1bca7b07 removed extraneous statements
46e6ae73 fixed indent and changed call to intial run
fcd39078 altered stopwatches start and stop code positions
29673814 removed debug code
e1845176 merge
06c48e17 Vertexai updates 20171101 (#24)

git-subtree-dir: public/plaidbench
git-subtree-split: 6335c29ca559b1a4aaa9b61f3e190c898a550593

* Squashed 'public/plaidvision/' changes from f213cfa..f32bd0b3

f32bd0b3 Vertexai updates 20171101 (#10)
e2ba2a45 Keep predictions sorted by confidence (#8)
0dcbf87 Update README.md (#9)
be3fe6f T1214: Port plaidvision to macOS (#7)
1e9e67a Made requirements less strict (#6)

git-subtree-dir: public/plaidvision
git-subtree-split: f32bd0b3a110e623a21c6a8f776f5d5287193b5c

* fix typo
tzerrell pushed a commit to tzerrell/plaidml that referenced this issue Oct 17, 2018
Remove telemetry, add Intel copyrights, Apache 2.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants