In [2]: model_RGB.train()
TypeError Traceback (most recent call last)
in ()
----> 1 model_RGB.train()
/home2/xzhe3946/S2VT/model_RGB.py in train()
247
248 def train():
--> 249 train_data = get_video_train_data(video_train_data_path, video_train_feat_path)
250 train_captions = train_data['Description'].values
251 test_data = get_video_test_data(video_test_data_path, video_test_feat_path)
/home2/xzhe3946/S2VT/model_RGB.py in get_video_train_data(video_data_path, video_feat_path)
184 def get_video_train_data(video_data_path, video_feat_path):
185 video_data = pd.read_csv(video_data_path, sep=',')
--> 186 video_data = video_data[video_data['Language'] == 'English']
187 video_data['video_path'] = video_data.apply(lambda row: row['VideoID']+''+str(int(row['Start']))+''+str(int(row['End']))+'.avi.npy', axis=1)
188 video_data['video_path'] = video_data['video_path'].map(lambda x: os.path.join(video_feat_path, x))
/usr/lib/python2.7/dist-packages/pandas/core/ops.pyc in wrapper(self, other)
574 # mask out the invalids
575 if mask.any():
--> 576 res[mask] = masker
577
578 return res
/usr/lib/python2.7/dist-packages/pandas/core/series.pyc in setitem(self, key, value)
633 key = _check_bool_indexer(self.index, key)
634 try:
--> 635 self.where(~key, value, inplace=True)
636 return
637 except (InvalidIndexError):
/usr/lib/python2.7/dist-packages/pandas/core/generic.pyc in where(self, cond, other, inplace, axis, level, try_cast, raise_on_error)
3024
3025 if inplace:
-> 3026 cond = -(cond.fillna(True).astype(bool))
3027 else:
3028 cond = cond.fillna(False).astype(bool)
/usr/lib/python2.7/dist-packages/pandas/core/series.pyc in neg(self)
999 # inversion
1000 def neg(self):
-> 1001 arr = operator.neg(self.values)
1002 return self._constructor(arr, self.index).finalize(self)
1003
TypeError: The numpy boolean negative, the - operator, is not supported, use the ~ operator or the logical_not function instead.
In [2]: model_RGB.train()
TypeError Traceback (most recent call last)
in ()
----> 1 model_RGB.train()
/home2/xzhe3946/S2VT/model_RGB.py in train()
247
248 def train():
--> 249 train_data = get_video_train_data(video_train_data_path, video_train_feat_path)
250 train_captions = train_data['Description'].values
251 test_data = get_video_test_data(video_test_data_path, video_test_feat_path)
/home2/xzhe3946/S2VT/model_RGB.py in get_video_train_data(video_data_path, video_feat_path)
184 def get_video_train_data(video_data_path, video_feat_path):
185 video_data = pd.read_csv(video_data_path, sep=',')
--> 186 video_data = video_data[video_data['Language'] == 'English']
187 video_data['video_path'] = video_data.apply(lambda row: row['VideoID']+''+str(int(row['Start']))+''+str(int(row['End']))+'.avi.npy', axis=1)
188 video_data['video_path'] = video_data['video_path'].map(lambda x: os.path.join(video_feat_path, x))
/usr/lib/python2.7/dist-packages/pandas/core/ops.pyc in wrapper(self, other)
574 # mask out the invalids
575 if mask.any():
--> 576 res[mask] = masker
577
578 return res
/usr/lib/python2.7/dist-packages/pandas/core/series.pyc in setitem(self, key, value)
633 key = _check_bool_indexer(self.index, key)
634 try:
--> 635 self.where(~key, value, inplace=True)
636 return
637 except (InvalidIndexError):
/usr/lib/python2.7/dist-packages/pandas/core/generic.pyc in where(self, cond, other, inplace, axis, level, try_cast, raise_on_error)
3024
3025 if inplace:
-> 3026 cond = -(cond.fillna(True).astype(bool))
3027 else:
3028 cond = cond.fillna(False).astype(bool)
/usr/lib/python2.7/dist-packages/pandas/core/series.pyc in neg(self)
999 # inversion
1000 def neg(self):
-> 1001 arr = operator.neg(self.values)
1002 return self._constructor(arr, self.index).finalize(self)
1003
TypeError: The numpy boolean negative, the
-operator, is not supported, use the~operator or the logical_not function instead.