Python 2.7 您的会话在使用Google Colab中的所有可用RAM后崩溃
我正试图让它在google colab上运行 我曾经能够让它运行并显示一次结果,但从那以后,最近我一直让你的会话在使用该单元的所有可用RAM后崩溃Python 2.7 您的会话在使用Google Colab中的所有可用RAM后崩溃,python-2.7,pytorch,google-colaboratory,torchvision,Python 2.7,Pytorch,Google Colaboratory,Torchvision,我正试图让它在google colab上运行 我曾经能够让它运行并显示一次结果,但从那以后,最近我一直让你的会话在使用该单元的所有可用RAM后崩溃 BASE_MODEL = '/scratch/shared/slow/ow/eccv/2018/release_models/' # Change to your path state_dict = torch.load(BASE_MODEL + 'x2face_model.pth') model = UnwrappedFaceWeight
BASE_MODEL = '/scratch/shared/slow/ow/eccv/2018/release_models/' # Change to your path
state_dict = torch.load(BASE_MODEL + 'x2face_model.pth')
model = UnwrappedFaceWeightedAverage(output_num_channels=2, input_num_channels=3, inner_nc=128)
model.load_state_dict(state_dict['state_dict'])
model = model.cuda()
model = model.eval()
我不确定这是否是colab问题
这是日志
warn("IPython.utils.traitlets has moved to a top-level traitlets package.")
/usr/local/lib/python2.7/dist-packages/IPython/utils/traitlets.py:5: UserWarning: IPython.utils.traitlets has moved to a top-level traitlets package.
尝试更改设置 转到运行时->更改运行时类型->硬件加速器->选择GPU或TPU选项
我认为这可能会有所帮助。我的经验是,转换到CPU colab版本,运行代码 然后切换到GPU colab版本 这些操作后,代码运行平稳