Pytorch自定义层含lambda函数(Lambda层)时保存模型出错的解决方案
出错 类型: _pickle.PicklingError: Can't pickle <function < lambda > at 0x0000000018944488>: attribute lookup < lambda > on __main__ failed 详情: File "C:\Users\piantou\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\serialization.py", line 224, in save return _with_file_like(f, "wb", lambda f: _save(obj, f, pickle_module, pickle_protocol)) File "C:\Users\piantou\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\serialization.py", line 149, in _with_file_like return body(f) File "C:\Users\piantou\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\serialization