Hello,
I’m using Google colab and working on notebooks saved on the my drive. To do so I do :
from google.colab import drive
drive.mount(’/content/gdrive’, force_remount=True)
%cd ./gdrive/My\ Drive/path/to/notebooks_folder
But when I do the %cd , everything works except learn.load() and I get this error :
AttributeError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/IPython/core/formatters.py in call(self, obj)
697 type_pprinters=self.type_printers,
698 deferred_pprinters=self.deferred_printers)
–> 699 printer.pretty(obj)
700 printer.flush()
701 return stream.getvalue()/usr/local/lib/python3.6/dist-packages/IPython/lib/pretty.py in pretty(self, obj)
396 if callable(meth):
397 return meth(obj, self, cycle)
–> 398 return _default_pprint(obj, self, cycle)
399 finally:
400 self.end_group()/usr/local/lib/python3.6/dist-packages/IPython/lib/pretty.py in _default_pprint(obj, p, cycle)
516 if _safe_getattr(klass, ‘repr’, None) not in baseclass_reprs:
517 # A user-provided repr. Find newlines and replace them with p.break()
–> 518 _repr_pprint(obj, p, cycle)
519 return
520 p.begin_group(1, ‘<’)/usr/local/lib/python3.6/dist-packages/IPython/lib/pretty.py in repr_pprint(obj, p, cycle)
707 “”“A pprint that just redirects to the normal repr function.”""
708 # Find newlines and replace them with p.break()
–> 709 output = repr(obj)
710 for idx,output_line in enumerate(output.splitlines()):
711 if idx:/usr/local/lib/python3.6/dist-packages/dataclasses.py in repr(self)
/usr/local/lib/python3.6/dist-packages/fastai/callback.py in repr(self)
159
160 def repr(self):
–> 161 attrs = func_args(self.init)
162 to_remove = getattr(self, ‘exclude’, [])
163 list_repr = [self.class.name] + [f’{k}: {getattr(self, k)}’ for k in attrs if k != ‘self’ and k not in to_remove]/usr/local/lib/python3.6/dist-packages/fastai/core.py in func_args(func)
241 def func_args(func)->bool:
242 “Return the arguments offunc
.”
–> 243 code = func.code
244 return code.co_varnames[:code.co_argcount]
245AttributeError: ‘method-wrapper’ object has no attribute ‘code’
load.save(‘stage-1’) works great and saves on the drive
learn.export() works
learn = load_learner(image_path) works
Any idea how I can fix it ? Thank you !