redpanda-ai / Meerkat

Used for the Meerkat project
Other
1 stars 1 forks source link

CNN on CPU #429

Closed speakerjohnash closed 8 years ago

speakerjohnash commented 8 years ago

To run the CNN on a CPU simply deploy the Meerkat AMI to a CPU based instance and replace the contents of meerkat/classification/lua_bridge.py with the attached file. The only changes are switching the tensor type from CudaTensor to DoubleTensor and removing any references to CUDA code.

CPU_lua_bridge.txt

nsivasu commented 8 years ago

@msevrens , We have applied the above changes in AWS C3 instance id: i-d6c82711 . But we are getting lots of 500 errors. Please find the error logs from Merkat Webserver.

2016-01-08 09:43:52,826 - tornado.application - ERROR - Uncaught exception POST /meerkat/ (172.31.28.243)
HTTPServerRequest(protocol='https', host='default-vpc-https-meerkat-lb-2053859962.us-west-2.elb.amazonaws.com', method='POST', uri='/meerkat/', version='HTTP/1.1', remote_ip='172.31.28.243', headers={'Content-Length': '16525', 'Content-Type': 'application/json; charset=UTF-8', 'X-Forwarded-Port': '443', 'User-Agent': 'Jakarta Commons-HttpClient/3.0.1', 'X-Forwarded-For': '121.244.95.1', 'Host': 'default-vpc-https-meerkat-lb-2053859962.us-west-2.elb.amazonaws.com', 'X-Forwarded-Proto': 'https', 'Connection': 'keep-alive'})
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/tornado/web.py", line 1415, in _execute
    result = yield result
  File "/usr/local/lib/python3.4/dist-packages/tornado/gen.py", line 870, in run
    value = future.result()
  File "/usr/local/lib/python3.4/dist-packages/tornado/concurrent.py", line 215, in result
    raise_exc_info(self._exc_info)
  File "", line 3, in raise_exc_info
  File "/usr/local/lib/python3.4/dist-packages/tornado/gen.py", line 876, in run
    yielded = self.gen.throw(*exc_info)
  File "/home/ubuntu/meerkat/Meerkat-1.5.3/meerkat/web_service/schema.py", line 65, in _wrapper
    output = yield output
  File "/usr/local/lib/python3.4/dist-packages/tornado/gen.py", line 870, in run
    value = future.result()
  File "/usr/local/lib/python3.4/dist-packages/tornado/concurrent.py", line 215, in result
    raise_exc_info(self._exc_info)
  File "", line 3, in raise_exc_info
  File "/usr/local/lib/python3.4/dist-packages/tornado/gen.py", line 876, in run
    yielded = self.gen.throw(*exc_info)
  File "/home/ubuntu/meerkat/Meerkat-1.5.3/meerkat/web_service/api.py", line 53, in post
    results = yield self.thread_pool.submit(self.meerkat.classify, data)
  File "/usr/local/lib/python3.4/dist-packages/tornado/gen.py", line 870, in run
    value = future.result()
  File "/usr/lib/python3.4/concurrent/futures/_base.py", line 395, in result
    return self.__get_result()
  File "/usr/lib/python3.4/concurrent/futures/_base.py", line 354, in __get_result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/ubuntu/meerkat/Meerkat-1.5.3/meerkat/web_service/web_consumer.py", line 472, in classify
    self.__apply_subtype_CNN(data)
  File "/home/ubuntu/meerkat/Meerkat-1.5.3/meerkat/web_service/web_consumer.py", line 430, in __apply_subtype_CNN
    txn_type, txn_sub_type = transaction["subtype_CNN"].split(" - ")
ValueError: need more than 1 value to unpack
2016-01-08 09:43:52,827 - tornado.access - ERROR - 500 POST /meerkat/ (172.31.28.243) 4162.00ms
speakerjohnash commented 8 years ago

That's an unrelated error. We've since fixed it.

speakerjohnash commented 8 years ago

No longer relevant now that we use tensorflow