Code Monkey home page Code Monkey logo

cnn_tsc's Introduction

CNN_tsc

A CNN for time-series classification

Explanation of the code at robromijnders.github.io/CNN_tsc

cnn_tsc's People

Contributors

robromijnders avatar tmorgan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cnn_tsc's Issues

TypeError: Fetch argument None has invalid type <class 'NoneType'>

Thanks for the nice skeleton repo @RobRomijnders :)

When I run your code off-the-shelf after the tf_upgrades to TF 1.xx I hit the following error:

Traceback (most recent call last):
  File "tsc_main.py", line 76, in <module>
    cost_val, summ,acc_val = sess.run([model.cost,model.merged,model.accuracy],feed_dict = {model.input: X_batch, model.labels: y_batch, model.keep_prob:1.0})
  File "/home/petteri/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 767, in run
    run_metadata_ptr)
  File "/home/petteri/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 952, in _run
    fetch_handler = _FetchHandler(self._graph, fetches, feed_dict_string)
  File "/home/petteri/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 408, in __init__
    self._fetch_mapper = _FetchMapper.for_fetch(fetches)
  File "/home/petteri/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 230, in for_fetch
    return _ListFetchMapper(fetch)
  File "/home/petteri/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 337, in __init__
    self._mappers = [_FetchMapper.for_fetch(fetch) for fetch in fetches]
  File "/home/petteri/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 337, in <listcomp>
    self._mappers = [_FetchMapper.for_fetch(fetch) for fetch in fetches]
  File "/home/petteri/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 227, in for_fetch
    (fetch, type(fetch)))
TypeError: Fetch argument None has invalid type <class 'NoneType'>

Invalid Argument Error when classes missing

When you run the tool with a dataset with a feature class missing e.g. 4 missing below

1,1.13324,1351.0,6862.4800000000005,3338.6999999999994,6859.446551724133
2,1.132653246753247,1350.7333333333336,6859.446551724133,4640.164285714285,6858.642028985517
3,1.132447198697068,1351.0458970099692,6858.642028985517,4996.519021739133,6860.627397260285
0,1.1325953916004556,1350.2446681415893,6860.627397260285,4993.749596774188,6862.286111111106
5,1.13324,1351.0,6862.4800000000005,3338.6999999999994,6859.446551724133

It throws:

InvalidArgumentError (see above for traceback): Received a label value of 5 which is outside the valid range of [0, 5).  Label values: 1 2 3 0 5 3 5 5 3 3 5 5 3 3 5 5 3 3 5 5 3 3 5 5 3 3 5 5 3 3 5 5 3 3 5 5 3 3 5 5
	 [[Node: SoftMax/SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits = SparseSoftmaxCrossEntropyWithLogits[T=DT_FLOAT, Tlabels=DT_INT64, _device="/job:localhost/replica:0/task:0/cpu:0"](Fully_Connected2/add, _recv_Ground_truth_0)]]

but is fine if all classes are present 1 to 5.

1,1.13324,1351.0,6862.4800000000005,3338.6999999999994,6859.446551724133
2,1.132653246753247,1350.7333333333336,6859.446551724133,4640.164285714285,6858.642028985517
3,1.132447198697068,1351.0458970099692,6858.642028985517,4996.519021739133,6860.627397260285
4,1.1325953916004556,1350.2446681415893,6860.627397260285,4993.749596774188,6862.286111111106
5,1.13324,1351.0,6862.4800000000005,3338.6999999999994,6859.446551724133

Is this expected or a bug or limitation?

How to extract predictions?

Thanks for the nice skeleton repo @RobRomijnders
I followed the given codes and was able to train a model and evaluate its accuracy.
However, the codes don't show how to make predictions given a model.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.