ArcGIS API for PythonのSingle Shot Detectorを用いて画像分類の深層学習(トレーニングデータからの抽出)をしているのですが、トレーニングデータを学習するコードを入力した際に下記のようなエラーが生じてしまいます。
このエラーの意味が分かる方いましたら、ご教授させていただけないでしょうか?
コードはJupyter Notebookを使用しております。
Python
1ssd.fit(epochs = 5, lr = slice(float(1e-3), float(1e-2))) 2ssd.lr_find() 3ssd.fit(epochs = 5, lr = slice(float(1e-3), float(1e-2)))
Error
1TypeError Traceback (most recent call last) 2<ipython-input-8-f5fcc504501f> in <module> 3----> 1 ssd.fit(epochs = 5, lr = slice(float(1e-3), float(1e-2))) 4 5~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\learn\models\_ssd.py in fit(self, epochs, lr) 6 177 ===================== =========================================== 7 178 """ 8--> 179 self.learn.fit(epochs, lr) 9 180 10 181 def unfreeze(self): 11 12~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\fastai\basic_train.py in fit(self, epochs, lr, wd, callbacks) 13 170 callbacks = [cb(self) for cb in self.callback_fns] + listify(callbacks) 14 171 fit(epochs, self.model, self.loss_func, opt=self.opt, data=self.data, metrics=self.metrics, 15--> 172 callbacks=self.callbacks+callbacks) 16 173 17 174 def create_opt(self, lr:Floats, wd:Floats=0.)->None: 18 19~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\fastai\basic_train.py in fit(epochs, model, loss_func, opt, data, callbacks, metrics) 20 92 except Exception as e: 21 93 exception = e 22---> 94 raise e 23 95 finally: cb_handler.on_train_end(exception) 24 96 25 26~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\fastai\basic_train.py in fit(epochs, model, loss_func, opt, data, callbacks, metrics) 27 87 if not data.empty_val: 28 88 val_loss = validate(model, data.valid_dl, loss_func=loss_func, 29---> 89 cb_handler=cb_handler, pbar=pbar) 30 90 else: val_loss=None 31 91 if cb_handler.on_epoch_end(val_loss): break 32 33~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\fastai\basic_train.py in validate(model, dl, loss_func, cb_handler, pbar, average, n_batch) 34 47 with torch.no_grad(): 35 48 val_losses,nums = [],[] 36---> 49 for xb,yb in progress_bar(dl, parent=pbar, leave=(pbar is not None)): 37 50 if cb_handler: xb, yb = cb_handler.on_batch_begin(xb, yb, train=False) 38 51 val_losses.append(loss_batch(model, xb, yb, loss_func, cb_handler=cb_handler)) 39 40~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\fastprogress\fastprogress.py in __iter__(self) 41 45 except Exception as e: 42 46 self.on_interrupt() 43---> 47 raise e 44 48 45 49 def update(self, val): 46 47~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\fastprogress\fastprogress.py in __iter__(self) 48 39 if self.total != 0: self.update(0) 49 40 try: 50---> 41 for i,o in enumerate(self.gen): 51 42 if i >= self.total: break 52 43 yield o 53 54~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\fastai\basic_data.py in __iter__(self) 55 68 def __iter__(self): 56 69 "Process and returns items from `DataLoader`." 57---> 70 for b in self.dl: yield self.proc_batch(b) 58 71 59 72 @classmethod 60 61~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\torch\utils\data\dataloader.py in __next__(self) 62 635 self.reorder_dict[idx] = batch 63 636 continue 64--> 637 return self._process_next_batch(batch) 65 638 66 639 next = __next__ # Python 2 compatibility 67 68~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\torch\utils\data\dataloader.py in _process_next_batch(self, batch) 69 656 self._put_indices() 70 657 if isinstance(batch, ExceptionWrapper): 71--> 658 raise batch.exc_type(batch.exc_msg) 72 659 return batch 73 660 74 75TypeError: Traceback (most recent call last): 76 File "C:\Users\tnyuk\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\torch\utils\data\dataloader.py", line 138, in _worker_loop 77 samples = collate_fn([dataset[i] for i in batch_indices]) 78 File "C:\Users\tnyuk\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\torch\utils\data\dataloader.py", line 138, in <listcomp> 79 samples = collate_fn([dataset[i] for i in batch_indices]) 80 File "C:\Users\tnyuk\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\fastai\data_block.py", line 544, in __getitem__ 81 if self.item is None: x,y = self.x[idxs],self.y[idxs] 82 File "C:\Users\tnyuk\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\fastai\data_block.py", line 94, in __getitem__ 83 if isinstance(idxs, numbers.Integral): return self.get(idxs) 84 File "C:\Users\tnyuk\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\fastai\vision\data.py", line 349, in get 85 return ImageBBox.create(*_get_size(self.x,i), *self.items[i], classes=self.classes, pad_idx=self.pad_idx) 86 File "C:\Users\tnyuk\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\fastai\vision\image.py", line 337, in create 87 bboxes = tensor(bboxes).float() 88 File "C:\Users\tnyuk\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\fastai\torch_core.py", line 70, in tensor 89 res = torch.tensor(x) if is_listy(x) else as_tensor(x) 90TypeError: can't convert np.ndarray of type numpy.object_. The only supported types are: double, float, float16, int64, int32, and uint8. 91
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。