Open gunchu opened 1 year ago
Current call passes the function directly, which fails with message:
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) [<ipython-input-10-78f6e5fc4f58>](https://localhost:8080/#) in <cell line: 1>() ----> 1 encoder = create_body(resnet34, cut=-2) 1 frames [/usr/local/lib/python3.9/dist-packages/fastai/vision/learner.py](https://localhost:8080/#) in cut_model(model, cut) 69 def cut_model(model, cut): 70 "Cut an instantiated model" ---> 71 if isinstance(cut, int): return nn.Sequential(*list(model.children())[:cut]) 72 elif callable(cut): return cut(model) 73 raise NameError("cut must be either integer or a function") AttributeError: 'function' object has no attribute 'children'
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
Current call passes the function directly, which fails with message: