610265158 / face_landmark

A simple method for face alignment based on wingloss and mutitask learning :)
Apache License 2.0
251 stars 80 forks source link

TypeError: object of type 'FaceKeypointDataIter' has no len() #35

Closed MirrorYuChen closed 4 years ago

MirrorYuChen commented 4 years ago

tensorflow版本为:1.14.0 平台为win7 64位 详细日志为: E:\gitee\face_landmark>python train.py d:\softW\Anaconda3\lib\site-packages\tensorflow\python\framework\dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type' . _np_qint8 = np.dtype([("qint8", np.int8, 1)]) d:\softW\Anaconda3\lib\site-packages\tensorflow\python\framework\dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type' . _np_quint8 = np.dtype([("quint8", np.uint8, 1)]) d:\softW\Anaconda3\lib\site-packages\tensorflow\python\framework\dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type' . _np_qint16 = np.dtype([("qint16", np.int16, 1)]) d:\softW\Anaconda3\lib\site-packages\tensorflow\python\framework\dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type' . _np_quint16 = np.dtype([("quint16", np.uint16, 1)]) d:\softW\Anaconda3\lib\site-packages\tensorflow\python\framework\dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type' . _np_qint32 = np.dtype([("qint32", np.int32, 1)]) d:\softW\Anaconda3\lib\site-packages\tensorflow\python\framework\dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type' . np_resource = np.dtype([("resource", np.ubyte, 1)]) d:\softW\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.p y:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is depre cated; in a future version of numpy, it will be understood as (type, (1,)) / '(1 ,)type'. _np_qint8 = np.dtype([("qint8", np.int8, 1)]) d:\softW\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.p y:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is depre cated; in a future version of numpy, it will be understood as (type, (1,)) / '(1 ,)type'. _np_quint8 = np.dtype([("quint8", np.uint8, 1)]) d:\softW\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.p y:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is depre cated; in a future version of numpy, it will be understood as (type, (1,)) / '(1 ,)type'. _np_qint16 = np.dtype([("qint16", np.int16, 1)]) d:\softW\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.p y:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is depre cated; in a future version of numpy, it will be understood as (type, (1,)) / '(1 ,)type'. _np_quint16 = np.dtype([("quint16", np.uint16, 1)]) d:\softW\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.p y:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is depre cated; in a future version of numpy, it will be understood as (type, (1,)) / '(1 ,)type'. _np_qint32 = np.dtype([("qint32", np.int32, 1)]) d:\softW\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.p y:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is depre cated; in a future version of numpy, it will be understood as (type, (1,)) / '(1 ,)type'. np_resource = np.dtype([("resource", np.ubyte, 1)]) [2020-03-30 00:54:18,748] [INFO] [x] Get dataset from [2020-03-30 00:54:20,975] [INFO] the dataset contains 196737 images [2020-03-30 00:54:20,975] [INFO] the datasets contains 196737 samples [2020-03-30 00:54:38,699] [INFO] the dataset with big mouth open 5076 images [2020-03-30 00:54:40,249] [INFO] befor balance the dataset contains 196737 image s [2020-03-30 00:54:40,249] [INFO] after balanced the datasets contains 2419377 sa mples Traceback (most recent call last): File "train.py", line 9, in trainner=trainner() File "E:\gitee\face_landmark\lib\core\base_trainer\network.py", line 21, in _init__ self.train_ds=DataIter(cfg.DATA.root_path,cfg.DATA.train_txt_path,True) File "E:\gitee\face_landmark\lib\dataset\dataietr.py", line 91, in init self.ds=self.build_iter() File "E:\gitee\face_landmark\lib\dataset\dataietr.py", line 105, in build_iter

ds = BatchData(ds, self.num_gpu *  self.batch_size)

File "d:\softW\Anaconda3\lib\site-packages\tensorpack\dataflow\common.py", lin e 98, in init assert batch_size <= len(ds) File "d:\softW\Anaconda3\lib\site-packages\tensorpack\dataflow\raw.py", line 1 15, in len return len(self._gen) TypeError: object of type 'FaceKeypointDataIter' has no len() 能否帮忙看一下是什么原因~

MirrorYuChen commented 4 years ago

使用的分支为tf1

MirrorYuChen commented 4 years ago

求大神指点一下,万分感谢~

610265158 commented 4 years ago

windows 好像跑不起来, 没有len 可以自己写一个len, 也可以用旧版本的tensorpack,最近我也遇到了这个问题

MirrorYuChen commented 4 years ago

哦哦,好的,谢谢啦~

yy19931029 commented 4 years ago

我也遇到了这个问题,不过当我把版本降低到tensorpack==0.8.6的时候,问题就不会出现了~