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

bidirectional wrapper throws assertFeedCompatibility error #213

Closed
m4nuC opened this issue Apr 22, 2018 · 4 comments
Closed

bidirectional wrapper throws assertFeedCompatibility error #213

m4nuC opened this issue Apr 22, 2018 · 4 comments

Comments

@m4nuC
Copy link

m4nuC commented Apr 22, 2018

TensorFlow.js version

v0.9.0

Browser version

Chrome V65

Describe the problem or feature request

Using a bidirectional wrapper around an LSTM layer throws the following error:
Uncaught (in promise) TypeError: Cannot read property 'dtype' of undefined at assertFeedCompatibility

Code to reproduce the bug / link to feature request

const X = tf.tensor(this.toOneHot([1, 2, 4, 8, 8, 8, 8], 10)).expandDims(0);
const Y =  tf.tensor(this.toOneHot([2, 4, 8, 8, 8, 8, 1], 10)).expandDims(0);

const model = tf.sequential();
const lstm = tf.layers.lstm({units: 5, returnSequences: true, batchInputShape: [1, 7, 10]})
model.add(
  tf.layers.bidirectional({layer: lstm, inputShape: [7, 10], mergeMode:'add'})
)
model.add(tf.layers.dense({units: 10, activation: 'softmax'}))
model.compile({
  optimizer: tf.train.adam(0.01),
  loss: 'categoricalCrossentropy',
  metrics: ['accuracy']
})

for( let i = 0; i < 5; i ++ ) {
  const history = await model.fit( X, Y, {batchSize: 1, epochs: 1});
  console.log(history.history.loss)
}

const predict = model.predict(X, {verbose: true, batchSize:1})
tf.argMax(predict, 2).print()
@dadadel
Copy link

dadadel commented Apr 27, 2018

Hi,

I've got the same issue with version 0.10.0

@m4nuC
Copy link
Author

m4nuC commented May 6, 2018

Is anyone working on this ? Else if someone can point me in the right direction I am happy to take a stab at it.

@rthadur
Copy link
Contributor

rthadur commented Oct 30, 2018

@m4nuC Please let us know if this still an issue ?

@rthadur
Copy link
Contributor

rthadur commented Nov 9, 2018

Automatically closing due to lack of recent activity. Please update the issue when new information becomes available, and we will reopen the issue. Thanks!

@rthadur rthadur closed this as completed Nov 9, 2018
nsthorat pushed a commit that referenced this issue Aug 19, 2019
* 0.3.x: Update the publish-npm script to allow publishing from the release branch. (#203)

DEV

* Upgrade 0.3.x to 0.15.3 (#210)


<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/tensorflow/tfjs-node/210)
<!-- Reviewable:end -->

* Fix win GPU packaging. (#208) (#211)

Turns out that the windows GPU builds for TensorFlow 1.12 lack the directory structure and eager headers. A bug has been filed with core TF - but we should bake in some fixes for this.

This PR simply refactors the downloading logic to a new file. I'd like to use this logic in the node-gles package as well (maybe worth releasing as a stand-alone package in the future).

After the refactoring, I check the directory structure in Windows. If the folder structure is missing, but the required tensorflow.dll exists - I re-create the directory structure, move and download the proper header files.

The screenshot below shows the contents of TF 1.12 Windows GPU:
![capture](https://user-images.githubusercontent.com/306276/53048799-719f4b80-344a-11e9-9004-3eef2446a246.PNG)

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/tensorflow/tfjs-node/208)
<!-- Reviewable:end -->

* Bump 0.3.1

* Add TensorBoard callback for model training: tf.node.tensorBoard() (#202) (#213)

FEATURE

See example screenshot:
![image](https://user-images.githubusercontent.com/16824702/52491877-19d52a80-2b96-11e9-8c24-5a403c2450d3.png)

Fixes #686

* [0.3.x] Upgrade nyc package fo fix lodash security issue. (#218) (#219)

Bump for 0.3.x so we can get a security release spun.

https://github.com/tensorflow/tfjs-node/network/alert/yarn.lock/lodash/open

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/tensorflow/tfjs-node/219)
<!-- Reviewable:end -->

* Bump to 0.3.2

* Upgrade TS libraries and change binding from typings file to plain
TypeScript definition.

* Upgrade TS dependencies

* save

* Fix deps-stage

* save

* Revert TS changes and keep binary staging fixes.
nsthorat pushed a commit that referenced this issue Aug 19, 2019
* 0.3.x: Update the publish-npm script to allow publishing from the release branch. (#203)

DEV

* Upgrade 0.3.x to 0.15.3 (#210)


<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/tensorflow/tfjs-node/210)
<!-- Reviewable:end -->

* Fix win GPU packaging. (#208) (#211)

Turns out that the windows GPU builds for TensorFlow 1.12 lack the directory structure and eager headers. A bug has been filed with core TF - but we should bake in some fixes for this.

This PR simply refactors the downloading logic to a new file. I'd like to use this logic in the node-gles package as well (maybe worth releasing as a stand-alone package in the future).

After the refactoring, I check the directory structure in Windows. If the folder structure is missing, but the required tensorflow.dll exists - I re-create the directory structure, move and download the proper header files.

The screenshot below shows the contents of TF 1.12 Windows GPU:
![capture](https://user-images.githubusercontent.com/306276/53048799-719f4b80-344a-11e9-9004-3eef2446a246.PNG)

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/tensorflow/tfjs-node/208)
<!-- Reviewable:end -->

* Bump 0.3.1

* Add TensorBoard callback for model training: tf.node.tensorBoard() (#202) (#213)

FEATURE

See example screenshot:
![image](https://user-images.githubusercontent.com/16824702/52491877-19d52a80-2b96-11e9-8c24-5a403c2450d3.png)

Fixes #686

* [0.3.x] Upgrade nyc package fo fix lodash security issue. (#218) (#219)

Bump for 0.3.x so we can get a security release spun.

https://github.com/tensorflow/tfjs-node/network/alert/yarn.lock/lodash/open

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/tensorflow/tfjs-node/219)
<!-- Reviewable:end -->

* Bump to 0.3.2

* Upgrade TS libraries and change binding from typings file to plain
TypeScript definition.

* Upgrade TS dependencies

* save

* Fix deps-stage

* save

* Revert TS changes and keep binary staging fixes.

* Don't use a definition file for the bindings.

This causes many issues and doesn't help with redistribution. It looks
like exporting a local definition file on top of what else is exported
is not a common supported TypeScript use case. This fix simply moves
defnitions into a normal TypeScript file.

This should fix: #1092

* save

* Add typescript integration project.

* save

* Add license
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants