Open mediaproduction opened 5 years ago
sir can you help me i am getting below error
File "G:\Chat-Bot-Emotion-Recognition-History-Recollection-master\context_recognition.py", line 46, in load_model self.tf_idf = pickle.load(open(self.load_file, 'rb')) UnicodeDecodeError: 'ascii' codec can't decode byte 0x9c in position 0: ordinal not in range(128)
sir can you help me i am getting below error
File "G:\Chat-Bot-Emotion-Recognition-History-Recollection-master\context_recognition.py", line 46, in load_model self.tf_idf = pickle.load(open(self.load_file, 'rb')) UnicodeDecodeError: 'ascii' codec can't decode byte 0x9c in position 0: ordinal not in range(128)
to fix that do this
def load_model(self):
with open(self.load_file, 'rb') as b:
self.tf_idf = pickle.load(b, encoding='bytes')
with open('current_models/tfidf_matrix.pkl','rb') as a:
self.tf_idf_matrix = pickle.load(a, encoding='bytes')
self.model_loaded = True
packages did you find solution to this ?
when i run python chatbot.py command, a black screen appeared for 5 second then it automatically closed with this message.
Please help to solve this
root@kali:~/Downloads/Chat-Bot-Emotion-Recognition-History-Recollection-master# python chatbot.py /usr/local/lib/python2.7/dist-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from
emotion.start()
File "/root/Downloads/Chat-Bot-Emotion-Recognition-History-Recollection-master/emotion_recognition.py", line 84, in start
self.model.load('current_models/model_resnet_emotion-42000')
File "/usr/local/lib/python2.7/dist-packages/tflearn/models/dnn.py", line 308, in load
self.trainer.restore(model_file, weights_only, **optargs)
File "/usr/local/lib/python2.7/dist-packages/tflearn/helpers/trainer.py", line 490, in restore
self.restorer.restore(self.session, model_file)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 1775, in restore
{self.saver_def.filename_tensor_name: save_path})
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 905, in run
run_metadata_ptr)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1140, in _run
feed_dict_tensor, options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1321, in _do_run
run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1340, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.NotFoundError: Key BatchNormalization/moving_mean not found in checkpoint
[[Node: save_1/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_BOOL, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save_1/Const_0_0, save_1/RestoreV2/tensor_names, save_1/RestoreV2/shape_and_slices)]]
float
tonp.floating
is deprecated. In future, it will be treated asnp.float64 == np.dtype(float).type
. from ._conv import register_converters as _register_converters WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/datasets/base.py:198: retry (from tensorflow.contrib.learn.python.learn.datasets.base) is deprecated and will be removed in a future version. Instructions for updating: Use the retry module or similar alternatives. ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map /usr/local/lib/python2.7/dist-packages/sklearn/base.py:251: UserWarning: Trying to unpickle estimator TfidfTransformer from version 0.18.1 when using version 0.20.2. This might lead to breaking code or invalid results. Use at your own risk. UserWarning) /usr/local/lib/python2.7/dist-packages/sklearn/base.py:251: UserWarning: Trying to unpickle estimator TfidfVectorizer from version 0.18.1 when using version 0.20.2. This might lead to breaking code or invalid results. Use at your own risk. UserWarning) WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tflearn/initializations.py:119: init (from tensorflow.python.ops.init_ops) is deprecated and will be removed in a future version. Instructions for updating: Use tf.initializers.variance_scaling instead with distribution=uniform to get equivalent behavior. WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tflearn/objectives.py:66: calling reduce_sum (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version. Instructions for updating: keep_dims is deprecated, use keepdims instead 2019-01-02 00:27:15.240270: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2019-01-02 00:27:20.340130: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at save_restore_v2_ops.cc:184 : Not found: Key BatchNormalization/moving_mean not found in checkpoint Traceback (most recent call last): File "chatbot.py", line 77, inCaused by op u'save_1/RestoreV2', defined at: File "chatbot.py", line 77, in
emotion.start()
File "/root/Downloads/Chat-Bot-Emotion-Recognition-History-Recollection-master/emotion_recognition.py", line 82, in start
clip_gradients=0.)
File "/usr/local/lib/python2.7/dist-packages/tflearn/models/dnn.py", line 65, in init
best_val_accuracy=best_val_accuracy)
File "/usr/local/lib/python2.7/dist-packages/tflearn/helpers/trainer.py", line 147, in init
allow_empty=True)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 1311, in init
self.build()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 1320, in build
self._build(self._filename, build_save=True, build_restore=True)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 1357, in _build
build_save=build_save, build_restore=build_restore)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 809, in _build_internal
restore_sequentially, reshape)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 448, in _AddRestoreOps
restore_sequentially)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 860, in bulk_restore
return io_ops.restore_v2(filename_tensor, names, slices, dtypes)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_io_ops.py", line 1458, in restore_v2
shape_and_slices=shape_and_slices, dtypes=dtypes, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 3290, in create_op
op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1654, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access
NotFoundError (see above for traceback): Key BatchNormalization/moving_mean not found in checkpoint [[Node: save_1/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_BOOL, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save_1/Const_0_0, save_1/RestoreV2/tensor_names, save_1/RestoreV2/shape_and_slices)]]