TypeError: 'NoneType' object is not callable
Deerzh opened this issue · 1 comments
Hi, when I have run this command: python ./spert.py predict --config configs/example_predict.conf,
an error occurred,like this:Traceback (most recent call last):
File "/home/zhang/anaconda3/envs/spert/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/home/zhang/anaconda3/envs/spert/lib/python3.7/multiprocessing/process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "/home/zhang/compatibility_analysis/spert/spert.py", line 39, in __predict
input_reader_cls=input_reader.JsonPredictionInputReader)
File "/home/zhang/compatibility_analysis/spert/spert/spert_trainer.py", line 143, in predict
dataset = input_reader.read(dataset_path, 'dataset')
File "/home/zhang/compatibility_analysis/spert/spert/input_reader.py", line 201, in read
self._parse_dataset(dataset_path, dataset)
File "/home/zhang/compatibility_analysis/spert/spert/input_reader.py", line 208, in _parse_dataset
self._parse_document(document, dataset)
File "/home/zhang/compatibility_analysis/spert/spert/input_reader.py", line 216, in _parse_document
jtokens = [t.text for t in self._nlp(document)]
TypeError: 'NoneType' object is not callable
And then, I checked configs/example_predict.conf, I found this sentence:
predictions_path = data/predictions.json. But in data route, predictions.json doesn't exist.
Can you help me fixed this problem?
Hi, when I have run this command: python ./spert.py predict --config configs/example_predict.conf, an error occurred,like this:Traceback (most recent call last): File "/home/zhang/anaconda3/envs/spert/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap self.run() File "/home/zhang/anaconda3/envs/spert/lib/python3.7/multiprocessing/process.py", line 99, in run self._target(*self._args, **self._kwargs) File "/home/zhang/compatibility_analysis/spert/spert.py", line 39, in __predict input_reader_cls=input_reader.JsonPredictionInputReader) File "/home/zhang/compatibility_analysis/spert/spert/spert_trainer.py", line 143, in predict dataset = input_reader.read(dataset_path, 'dataset') File "/home/zhang/compatibility_analysis/spert/spert/input_reader.py", line 201, in read self._parse_dataset(dataset_path, dataset) File "/home/zhang/compatibility_analysis/spert/spert/input_reader.py", line 208, in _parse_dataset self._parse_document(document, dataset) File "/home/zhang/compatibility_analysis/spert/spert/input_reader.py", line 216, in _parse_document jtokens = [t.text for t in self._nlp(document)] TypeError: 'NoneType' object is not callable
And then, I checked configs/example_predict.conf, I found this sentence: predictions_path = data/predictions.json. But in data route, predictions.json doesn't exist. Can you help me fixed this problem?
I meet the same problem, I found the reason is that you foget pip install spacy!