You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def variable_on_device(self, name, shape, initializer):
with tf.device('/cpu:0'):
var = tf.get_variable(name=name, shape=shape, initializer=initializer)
return var
然后运行我得到如下错误:
Traceback (most recent call last):
File "tf_speech.py", line 27, in <module>
re = X.speech_to_text('./test_voice/D4_750.wav')
File "tf_speech.py", line 22, in speech_to_text
res = bi_rnn.build_target_wav_file_test(wav_files, self.text_labels)
File "/home/zh/sda2/sg-ai/Detox_AI/tf_recong/model.py", line 213, in build_target_wav_file_test
self.init_session()
File "/home/zh/sda2/sg-ai/Detox_AI/tf_recong/model.py", line 184, in init_session
ckpt = tf.train.latest_checkpoint(self.savedir)
File "/home/zh/sda3/Anaconda3/envs/deep2.0.0/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1805, in latest_checkpoint
ckpt = get_checkpoint_state(checkpoint_dir, latest_filename)
File "/home/zh/sda3/Anaconda3/envs/deep2.0.0/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1061, in get_checkpoint_state
text_format.Merge(file_content, ckpt)
File "/home/zh/sda3/Anaconda3/envs/deep2.0.0/lib/python3.6/site-packages/google/protobuf/text_format.py", line 536, in Merge
descriptor_pool=descriptor_pool)
File "/home/zh/sda3/Anaconda3/envs/deep2.0.0/lib/python3.6/site-packages/google/protobuf/text_format.py", line 590, in MergeLines
return parser.MergeLines(lines, message)
File "/home/zh/sda3/Anaconda3/envs/deep2.0.0/lib/python3.6/site-packages/google/protobuf/text_format.py", line 623, in MergeLines
self._ParseOrMerge(lines, message)
File "/home/zh/sda3/Anaconda3/envs/deep2.0.0/lib/python3.6/site-packages/google/protobuf/text_format.py", line 638, in _ParseOrMerge
self._MergeField(tokenizer, message)
File "/home/zh/sda3/Anaconda3/envs/deep2.0.0/lib/python3.6/site-packages/google/protobuf/text_format.py", line 763, in _MergeField
merger(tokenizer, message, field)
File "/home/zh/sda3/Anaconda3/envs/deep2.0.0/lib/python3.6/site-packages/google/protobuf/text_format.py", line 888, in _MergeScalarField
value = tokenizer.ConsumeString()
File "/home/zh/sda3/Anaconda3/envs/deep2.0.0/lib/python3.6/site-packages/google/protobuf/text_format.py", line 1251, in ConsumeString
the_bytes = self.ConsumeByteString()
File "/home/zh/sda3/Anaconda3/envs/deep2.0.0/lib/python3.6/site-packages/google/protobuf/text_format.py", line 1266, in ConsumeByteString
the_list = [self._ConsumeSingleByteString()]
File "/home/zh/sda3/Anaconda3/envs/deep2.0.0/lib/python3.6/site-packages/google/protobuf/text_format.py", line 1291, in _ConsumeSingleByteString
result = text_encoding.CUnescape(text[1:-1])
File "/home/zh/sda3/Anaconda3/envs/deep2.0.0/lib/python3.6/site-packages/google/protobuf/text_encoding.py", line 103, in CUnescape
result = ''.join(_cescape_highbit_to_str[ord(c)] for c in result)
File "/home/zh/sda3/Anaconda3/envs/deep2.0.0/lib/python3.6/site-packages/google/protobuf/text_encoding.py", line 103, in <genexpr>
result = ''.join(_cescape_highbit_to_str[ord(c)] for c in result)
IndexError: list index out of range
请问我能怎么在CPU上运行呢?谢谢
The text was updated successfully, but these errors were encountered:
你好,我在测试的时候,由于环境的限制,我不得不改在CPU上运行,但是我更改了
model.py
中如下代码:然后运行我得到如下错误:
请问我能怎么在CPU上运行呢?谢谢
The text was updated successfully, but these errors were encountered: