用hub在自定义数据集上finetune时报错
发布于2020-08-27 17:53 浏览:861 回复:3
0
收藏

[2020-08-27 17:46:02,121] [ INFO] - Strategy with slanted triangle learning rate, L2 regularization,
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/executor.py:1093: UserWarning: There are no operators in the program to be executed. If you pass Program manually, please use fluid.program_guard to ensure the current Program is being used.
warnings.warn(error_info)
[2020-08-27 17:46:04,683] [ INFO] - Try loading checkpoint from source/ckpt.meta
[2020-08-27 17:46:04,684] [ INFO] - PaddleHub model checkpoint not found, start from scratch...
[2020-08-27 17:46:04,739] [ INFO] - PaddleHub finetune start
2020-08-27 17:46:04,764-WARNING: Your reader has raised an exception!
Exception in thread Thread-6:
Traceback (most recent call last):
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/reader.py", line 1156, in __thread_main__
six.reraise(*sys.exc_info())
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/six.py", line 703, in reraise
raise value
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/reader.py", line 1136, in __thread_main__
for tensors in self._tensor_reader():
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddlehub/reader/cv_reader.py", line 168, in _data_reader
labels.append([np.int64(label)])
ValueError: invalid literal for int() with base 10: 'c2'


---------------------------------------------------------------------------EnforceNotMet Traceback (most recent call last) in
----> 1 run_states = task.finetune_and_eval()
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddlehub/finetune/task/base_task.py in finetune_and_eval(self)
943
944 def finetune_and_eval(self):
--> 945 return self.finetune(do_eval=True)
946
947 def finetune(self, do_eval=False):
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddlehub/finetune/task/base_task.py in finetune(self, do_eval)
964 while self.current_epoch <= self.config.num_epoch:
965 self.config.strategy.step()
--> 966 run_states = self._run(do_eval=do_eval)
967 self.env.current_epoch += 1
968
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddlehub/finetune/task/base_task.py in _run(self, do_eval)
1197 global_run_states = []
1198 period_run_states = []
-> 1199 for batch in data_reader():
1200 step_run_state = RunState(len(self.fetch_list))
1201 step_run_state.run_step = 1
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/reader.py in __next__(self)
1100 return self._reader.read_next_list()
1101 else:
-> 1102 return self._reader.read_next()
1103 except StopIteration:
1104 self._queue.close()
EnforceNotMet:

--------------------------------------------
C++ Call Stacks (More useful to developers):
--------------------------------------------
0 std::string paddle::platform::GetTraceBackString(std::string const&, char const*, int)
1 paddle::platform::EnforceNotMet::EnforceNotMet(std::string const&, char const*, int)
2 paddle::operators::reader::BlockingQueue > >::Receive(std::vector >*)
3 paddle::operators::reader::PyReader::ReadNext(std::vector >*)
4 std::_Function_handler (), std::__future_base::_Task_setter, std::__future_base::_Result_base::_Deleter>, unsigned long> >::_M_invoke(std::_Any_data const&)
5 std::__future_base::_State_base::_M_do_set(std::function ()>&, bool&)
6 ThreadPool::ThreadPool(unsigned long)::{lambda()#1}::operator()() const

----------------------
Error Message Summary:
----------------------
Error: Blocking queue is killed because the data reader raises an exception
[Hint: Expected killed_ != true, but received killed_:1 == true:1.] at (/paddle/paddle/fluid/operators/reader/blocking_queue.h:141)

 

 

 

 

有没有小伙伴遇到过这种情况哇

收藏
点赞
0
个赞
共3条回复 最后由回复于2020-08-29 10:22
#4回复于2020-08-29 10:22:51

改帖已自我解决,问题出在标签上:

ValueError: invalid literal for int() with base 10: 'c2'

我标签类别没有修改成整数01234567这样所以报错,修改之后就好了

 

0
#3回复于2020-08-29 10:21:29

嗷不好意思,错帖了.....

0
#2回复于2020-08-29 10:20:26

ok了已自我解决,解决方案:

1.paddlepaddle选择1.8.0以上的版本

2.升级paddlehub至最新版本

0
TOP
切换版块