Error: Argument 'x' passed to 'slice' must be a Tensor, but got object.
at assert (/Users/loretoparisi/Documents/Projects/AI/tfjs-examples/sentiment/node_modules/@tensorflow/tfjs-core/dist/util.js:57:15)
at assertArgumentIsTensor (/Users/loretoparisi/Documents/Projects/AI/tfjs-examples/sentiment/node_modules/@tensorflow/tfjs-core/dist/util.js:5:5)
at _loop_1 (/Users/loretoparisi/Documents/Projects/AI/tfjs-examples/sentiment/node_modules/@tensorflow/tfjs-core/dist/util.js:17:13)
at Object.assertArgumentsAreTensors (/Users/loretoparisi/Documents/Projects/AI/tfjs-examples/sentiment/node_modules/@tensorflow/tfjs-core/dist/util.js:21:9)
at SliceOps.slice (/Users/loretoparisi/Documents/Projects/AI/tfjs-examples/sentiment/node_modules/@tensorflow/tfjs-core/dist/ops/slice.js:34:14)
at /Users/loretoparisi/Documents/Projects/AI/tfjs-examples/sentiment/node_modules/@tensorflow/tfjs-core/dist/ops/operation.js:11:61
at Object.Tracking.tidy (/Users/loretoparisi/Documents/Projects/AI/tfjs-examples/sentiment/node_modules/@tensorflow/tfjs-core/dist/tracking.js:36:22)
at Function.descriptor.value [as slice] (/Users/loretoparisi/Documents/Projects/AI/tfjs-examples/sentiment/node_modules/@tensorflow/tfjs-core/dist/ops/operation.js:11:26)
at Object.SliceOps.slice2d (/Users/loretoparisi/Documents/Projects/AI/tfjs-examples/sentiment/node_modules/@tensorflow/tfjs-core/dist/ops/slice.js:23:25)
at /Users/loretoparisi/Documents/Projects/AI/tfjs-examples/sentiment/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend.js:118:28
Tensor {
isDisposedInternal: false,
size: 100,
shape: [ 1, 100 ],
dtype: 'float32',
strides: [ 100 ],
dataId: {},
id: 0,
rankType: '2' }
--
You received this message because you are subscribed to the Google Groups "TensorFlow.js Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tfjs+uns...@tensorflow.org.
Visit this group at https://groups.google.com/a/tensorflow.org/group/tfjs/.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tfjs/e7b69a49-ae43-46ce-aaa9-1de39b4f0bfc%40tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tfjs/6ec43747-eced-4396-a1cf-1b9f4c6e1362%40tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tfjs/0e7e0034-b8af-44e7-ac30-0f9dcd285e86%40tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tfjs/ed341173-6a4b-458f-8954-24eb7e2cc97c%40tensorflow.org.
ip-192-168-22-127:sentiment loretoparisi$ node sentiment.js
2018-06-27 11:01:25.185649: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.2 AVX AVX2 FMA
(node:76671) Warning: N-API is an experimental feature and could change at any time.
Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, which binds to TensorFlow C++, by running npm i @tensorflow/tfjs-node, or npm i @tensorflow/tfjs-node-gpu if you have CUDA. Then call require('tensorflow/tfjs-node'); (-gpu suffix for CUDA) at the start of your program. Visit https://github.com/tensorflow/tfjs-node for more details.
indexFrom = 3
maxLen = 100
model_type cnn
vocabulary_size 20000
max_len 100
[ 'this', 'is', 'a', 'bad', 'day' ]
this is a bad day
Tensor {
isDisposedInternal: false,
size: 100,
shape: [ 1, 100 ],
dtype: 'float32',
strides: [ 100 ],
dataId: {},
id: 22,
rankType: '2' }
{ score: 0.018475884571671486, elapsed: 1594.1342370510101 }
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tfjs/db99e41e-ebe3-4095-8464-e197fa82bf16%40tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tfjs/927eb017-d4fd-48fb-ab94-f3a9e57a3bcf%40tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tfjs/46fa5d05-acee-40df-8d5e-fbf102efd8d0%40tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tfjs/debd6945-753d-4e08-b4e1-57e897e5d2b4%40tensorflow.org.