lsh1994 / keras-segmentation

Get started with Semantic Segmentation based on Keras, including FCN32/FCN8/SegNet/U-Net
166 stars 55 forks source link

如何修改为tensorflow-gpu #1

Closed hello1010101010101world closed 5 years ago

hello1010101010101world commented 5 years ago

您好,我同样参考了https://github.com/divamgupta/image-segmentation-keras这个项目,这个项目的后台是Theano,我想换成Tensorflow_gpu.但是当我修改完并运行后fcn8 时报错:OOM when allocating tensor with shape[1,1,4096,4096];运行fcn32时发现均报错:OOM when allocating tensor with shape[7,7,512,4096].尽管我将输入数据设置为只有一张图片--2562563.我不清楚为什么会出现这个问题及如何解决.我的环境是:python3.6.6,tensorflow_gpu 1.3.0,keras2.0.0,显卡为p2000,5G显存.如果需要我可以将代码发给您看看.

lsh1994 commented 5 years ago

目测仍然是显存的问题,我运行的环境:GTX1080Ti,12G的显存;运行时大概占了0.8以上(记不清了)。你运行时也可以通过任务管理器看下GPU状态

发送自 Windows 10 版邮件https://go.microsoft.com/fwlink/?LinkId=550986应用


发件人: hello1010101010101world notifications@github.com 发送时间: Monday, November 26, 2018 11:10:39 AM 收件人: lsh1994/keras-fcn 抄送: Subscribed 主题: [lsh1994/keras-fcn] 如何修改为tensorflow-gpu (#1)

您好,我同样参考了https://github.com/divamgupta/image-segmentation-keras这个项目,这个项目的后台是Theano,我想换成Tensorflow_gpu.但是当我修改完并运行后fcn8https://github.com/divamgupta/image-segmentation-keras%E8%BF%99%E4%B8%AA%E9%A1%B9%E7%9B%AE,%E8%BF%99%E4%B8%AA%E9%A1%B9%E7%9B%AE%E7%9A%84%E5%90%8E%E5%8F%B0%E6%98%AFTheano,%E6%88%91%E6%83%B3%E6%8D%A2%E6%88%90Tensorflow_gpu.%E4%BD%86%E6%98%AF%E5%BD%93%E6%88%91%E4%BF%AE%E6%94%B9%E5%AE%8C%E5%B9%B6%E8%BF%90%E8%A1%8C%E5%90%8Efcn8 时报错:OOM when allocating tensor with shape[1,1,4096,4096];运行fcn32时发现均报错:OOM when allocating tensor with shape[7,7,512,4096].尽管我将输入数据设置为只有一张图片--2562563.我不清楚为什么会出现这个问题及如何解决.我的环境是:python3.6.6,tensorflow_gpu 1.3.0,keras2.0.0,显卡为p2000,5G显存.如果需要我可以将代码发给您看看.

― You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/lsh1994/keras-fcn/issues/1, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ANsKRlJDGvPlmxzNMiGSdgsCp73xF29Qks5uy1uvgaJpZM4YyP7t.

hello1010101010101world commented 5 years ago

我之前使用的时tensorflow cpu版本,虽然速度慢但可以运行,内存为16G.修改为gpu版本后却显存溢出,也许是因为显存的问题.但是仍有一个疑问,是否可以通过修改卷积的网络层数与大小来避免显存的溢出呢?

lius0-0 commented 5 years ago

问下实际使用预测结果怎么样啊