Are there any environment python version dependencies on executing Nupic
NLP?
Current Environment:
Python Version: 2.7.3
requests module version: 2.0.0
json module version: 2.0.9
simplejson module version: 2.3.2
Command Execution:
./run_association_experiment.py resources/animals.txt
resources/vegetables.txt -p 100 -t 1000 -v
I had to modify the following file for parsing the json data to fix the
following error:
TypeError: 'instancemethod' object has no attribute '__getitem__'
Repository: git://github.com/numenta/pycept.git
File: /usr/local/lib/python2.7/dist-packages/pycept/cept.py
GetBitmap function, line 66:
cached_sdr = response.json['bitmap'] -> cached_sdr =
response.json()['bitmap']
bitmapToTermsRaw function, line 101:
return response.json -> return response.json()
However, upon fixing these errors, I will then receive the following
decoding error sometimes.
I guess this is not the correct way to fix the parsing of json. Any ideas?
Traceback (most recent call last):
File "./run_association_experiment.py", line 80, in <module>
main()
File "./run_association_experiment.py", line 76, in main
runner.random_dual_association(args[0], args[1])
File "/home/akamlani/projects/numenta/nupic_nlp/nupic_nlp/runner.py",
line 65, in random_dual_association
self.associate(associations)
File "/home/akamlani/projects/numenta/nupic_nlp/nupic_nlp/runner.py",
line 40, in associate
term2_prediction = self._feed_term(term1, fetch_result)
File "/home/akamlani/projects/numenta/nupic_nlp/nupic_nlp/runner.py",
line 82, in _feed_term
predicted_word = self.builder.closest_term(predicted_bitmap)
File
"/home/akamlani/projects/numenta/nupic_nlp/nupic_nlp/sdr_builder.py", line
61, in closest_term
128, 128, bitmap)
File "/usr/local/lib/python2.7/dist-packages/pycept/cept.py", line 87, in
bitmapToTerms
response = self.bitmapToTermsRaw(width, height, onBits)
File "/usr/local/lib/python2.7/dist-packages/pycept/cept.py", line 102,
in bitmapToTermsRaw
return response.json()
File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line
690, in json
return json.loads(self.text or self.content, **kwargs)
File "/usr/lib/python2.7/dist-packages/simplejson/__init__.py", line 413,
in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/dist-packages/simplejson/decoder.py", line 402,
in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/dist-packages/simplejson/decoder.py", line 420,
in raw_decode
raise JSONDecodeError("No JSON object could be decoded", s, idx)
simplejson.decoder.JSONDecodeError: No JSON object could be decoded: line 2
column 1 (char 1)
Thanks
Ari
_______________________________________________
nupic mailing list
[email protected]
http://lists.numenta.org/mailman/listinfo/nupic_lists.numenta.org