danielelic / deep-casas Goto Github PK
View Code? Open in Web Editor NEWDeep learning and LSTM approaches for human activity recognition
Deep learning and LSTM approaches for human activity recognition
Hi,
when I want to run "train.py --v lstm" I have this error, ValueError: Supported target types are: ('binary', 'multiclass'). Got 'unknown' instead.
can you guide me on how to fix it?
thank you.
As I understand, you ignore the irregular timing (time-lags as in your paper says) between sensor events and you feed the sensor values (binary-value vector) to LSTM, is that correct?
Hello everybody,
I have installed: Python 3.5.2, numpy==1.14.1, tensorflow==1.3.0, scikit-learn==0.19.0, keras==2.1.5 and h5py.
The following scripts run fine:
python train.py --v LSTM
python train.py --v biLSTM
python train.py --v CascadeLSTM
Nevertheless, when I run ensembles i.e.:
python train.py --v Ensemble2LSTM or
python train.py --v CascadeEnsembleLSTM
I get the following error message:
Traceback (most recent call last):
File "C:\Users\u24t06\Desktop\Experiments\Experiment_5_1\venv\lib\site-packages\tensorflow\python\client\session.py", line 1327, in _do_call
return fn(*args)
File "C:\Users\u24t06\Desktop\Experiments\Experiment_5_1\venv\lib\site-packages\tensorflow\python\client\session.py", line 1306, in _run_fn
status, run_metadata)
File "C:\Users\u24t06\AppData\Local\Programs\Python\Python35\lib\contextlib.py", line 66, in exit
next(self.gen)
File "C:\Users\u24t06\Desktop\Experiments\Experiment_5_1\venv\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 466, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: indices[0,1363] = 9 is not in [0, 2)
[[Node: embedding_2/Gather = Gather[Tindices=DT_INT32, Tparams=DT_FLOAT, validate_indices=true, _device="/job:localhost/replica:0/task:0/cpu:0"](embedding_2/embeddings/read, embedd
ing_2/Cast)]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "train.py", line 93, in
callbacks=[csv_logger, model_checkpoint])
File "C:\Users\u24t06\Desktop\Experiments\Experiment_5_1\venv\lib\site-packages\keras\models.py", line 963, in fit
validation_steps=validation_steps)
File "C:\Users\u24t06\Desktop\Experiments\Experiment_5_1\venv\lib\site-packages\keras\engine\training.py", line 1705, in fit
validation_steps=validation_steps)
File "C:\Users\u24t06\Desktop\Experiments\Experiment_5_1\venv\lib\site-packages\keras\engine\training.py", line 1235, in _fit_loop
outs = f(ins_batch)
File "C:\Users\u24t06\Desktop\Experiments\Experiment_5_1\venv\lib\site-packages\keras\backend\tensorflow_backend.py", line 2478, in call
**self.session_kwargs)
File "C:\Users\u24t06\Desktop\Experiments\Experiment_5_1\venv\lib\site-packages\tensorflow\python\client\session.py", line 895, in run
run_metadata_ptr)
File "C:\Users\u24t06\Desktop\Experiments\Experiment_5_1\venv\lib\site-packages\tensorflow\python\client\session.py", line 1124, in _run
feed_dict_tensor, options, run_metadata)
File "C:\Users\u24t06\Desktop\Experiments\Experiment_5_1\venv\lib\site-packages\tensorflow\python\client\session.py", line 1321, in _do_run
options, run_metadata)
File "C:\Users\u24t06\Desktop\Experiments\Experiment_5_1\venv\lib\site-packages\tensorflow\python\client\session.py", line 1340, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: indices[0,1363] = 9 is not in [0, 2)
[[Node: embedding_2/Gather = Gather[Tindices=DT_INT32, Tparams=DT_FLOAT, validate_indices=true, _device="/job:localhost/replica:0/task:0/cpu:0"](embedding_2/embeddings/read, embedd
ing_2/Cast)]]
Caused by op 'embedding_2/Gather', defined at:
File "train.py", line 66, in
model = models.get_Ensemble2LSTM(input_dim, units, data.max_lenght, no_activities)
File "C:\Users\u24t06\Desktop\Experiments\Experiment_5_1\models.py", line 38, in get_Ensemble2LSTM
model2.add(Embedding(input_dim, output_dim, input_length=max_lenght, mask_zero=True))
File "C:\Users\u24t06\Desktop\Experiments\Experiment_5_1\venv\lib\site-packages\keras\models.py", line 467, in add
layer(x)
File "C:\Users\u24t06\Desktop\Experiments\Experiment_5_1\venv\lib\site-packages\keras\engine\topology.py", line 619, in call
output = self.call(inputs, **kwargs)
File "C:\Users\u24t06\Desktop\Experiments\Experiment_5_1\venv\lib\site-packages\keras\layers\embeddings.py", line 138, in call
out = K.gather(self.embeddings, inputs)
File "C:\Users\u24t06\Desktop\Experiments\Experiment_5_1\venv\lib\site-packages\keras\backend\tensorflow_backend.py", line 1211, in gather
return tf.gather(reference, indices)
File "C:\Users\u24t06\Desktop\Experiments\Experiment_5_1\venv\lib\site-packages\tensorflow\python\ops\array_ops.py", line 2409, in gather
validate_indices=validate_indices, name=name)
File "C:\Users\u24t06\Desktop\Experiments\Experiment_5_1\venv\lib\site-packages\tensorflow\python\ops\gen_array_ops.py", line 1219, in gather
validate_indices=validate_indices, name=name)
File "C:\Users\u24t06\Desktop\Experiments\Experiment_5_1\venv\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 767, in apply_op
op_def=op_def)
File "C:\Users\u24t06\Desktop\Experiments\Experiment_5_1\venv\lib\site-packages\tensorflow\python\framework\ops.py", line 2630, in create_op
original_op=self._default_original_op, op_def=op_def)
File "C:\Users\u24t06\Desktop\Experiments\Experiment_5_1\venv\lib\site-packages\tensorflow\python\framework\ops.py", line 1204, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access
InvalidArgumentError (see above for traceback): indices[0,1363] = 9 is not in [0, 2)
[[Node: embedding_2/Gather = Gather[Tindices=DT_INT32, Tparams=DT_FLOAT, validate_indices=true, _device="/job:localhost/replica:0/task:0/cpu:0"](embedding_2/embeddings/read, embedd
ing_2/Cast)]]
Does anyone know how to fix this error?
Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.