说到Python和机器学习,我是个笨蛋。我正在尝试运行两个不同的项目,这两个项目都与一种称为深度图像抠图(Deep Image Matting)的东西有关:
我只是想在这些项目中运行测试,但我遇到了各种问题。我可以在没有GPU的机器上运行这些吗?我原以为GPU只是为了加快处理速度,但我只对在使用GPU的机器之前运行这些程序感兴趣。 我事先道歉,因为我知道我在这件事上是个十足的傻瓜
当我尝试Tensorflow项目时:
gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction = args.gpu_fraction)
上得到一个错误,可能是因为我是tf2,这需要tf1W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
和InvalidArgumentError (see above for traceback): No OpKernel was registered to support Op 'MaxPoolWithArgmax' with these attrs. Registered devices: [CPU], Registered kernels:
<no registered kernels>
,现在我被卡住了,因为我不知道这意味着什么当我尝试Pytorch项目时:
RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.
map_location=torch.device('cpu')
,但是现在我得到了RuntimeError: Error(s) in loading state_dict for VGG16:
size mismatch for conv6_1.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 512, 3, 3]).
,我又被卡住了有人能帮忙吗
提前谢谢你
对于PyTorch one,有两个问题,看起来您已经用map_location自己解决了第一个问题。第二个问题是检查点中的权重和模型中的权重形状不同!快速绕过github回购协议;让我们访问内核中的net.py。请看第26到28行:
我猜检查点正在加载conv6_1的内核大小为1而不是3的权重,就像注释掉的代码行一样。因此,请尝试取消注释kernel_size=1的行,并注释掉kernel_size=3的行
相关问题 更多 >
编程相关推荐