Giter VIP home page Giter VIP logo

Comments (3)

CharlesPikachu avatar CharlesPikachu commented on May 30, 2024

你能check一下训练时候测试使用的数据和训练完之后使用的数据是否一致吗。就是check一下缓存的pkl文件里用的imageids是否一致。

from sssegmentation.

123AOQW avatar 123AOQW commented on May 30, 2024

我只找到了一个pkl文件,即./fcn_unets5os16_spider_ep20/fcn_unets5os16_spider_ep20_0.pkl(我当前所在的目录是sssegmentation)。我用下面的代码读取了这个文件:

import pickle

# 读取.pkl文件
with open('fcn_unets5os16_spider_ep20_0.pkl', 'rb') as f:
    data = pickle.load(f)

# 查看数据尺寸
print(len(data))     # 2
print(len(data[0]))  # 480
print(len(data[1]))  # 480

# 查看数据样式
print(data[0][0])
'''
['2601', array([[0, 0, 0, ..., 0, 0, 0],
       [0, 0, 0, ..., 0, 0, 0],
       [0, 0, 0, ..., 0, 0, 0],
       ...,
       [0, 0, 0, ..., 0, 0, 0],
       [0, 0, 0, ..., 0, 0, 0],
       [0, 0, 0, ..., 0, 0, 0]])]
'''
print(data[1][0])
'''
[[0 0 0 ... 0 0 0]
 [0 0 0 ... 0 0 0]
 [0 0 0 ... 0 0 0]
 ...
 [0 0 0 ... 0 0 0]
 [0 0 0 ... 0 0 0]
 [0 0 0 ... 0 0 0]]
 '''
 # 这里的列表也是array类型,只是用print单独打印出来时没显示

可见两个列表里保存的数据的样式不一样,第二个列表里没保存imageid。我比较了相同位置的表示图片的二维列表(我没搞清楚这里的array表示是预测完的结果还是原图),发现二者并不相同:

print(sum(data[0][0][1]==data[1][0]))
'''
[256 256 256 256 256 256 256 256 256 254 252 252 251 251 250 250 250 250
 249 249 249 248 249 251 249 249 248 248 248 248 250 251 252 251 248 247
 246 245 245 246 247 247 248 247 249 250 249 250 251 253 252 252 251 251
 250 250 251 253 253 251 243 242 240 248 249 242 238 238 230 227 225 224
 221 219 212 221 229 233 232 231 230 234 235 236 234 236 237 239 239 240
 238 239 238 240 238 240 241 239 240 240 238 237 238 240 233 226 221 215
 216 223 225 230 231 237 231 229 230 233 236 237 244 248 249 245 243 242
 240 235 237 235 235 228 222 224 229 238 238 228 235 248 253 255 255 254
 254 253 253 253 252 253 252 251 254 254 255 255 255 250 250 249 249 244
 237 232 237 242 242 242 247 235 234 234 233 232 237 234 239 243 245 250
 250 248 240 238 232 225 223 214 222 225 224 224 220 213 215 216 218 221
 224 230 229 227 227 227 226 223 229 230 225 219 218 216 221 222 225 236
 238 240 241 241 241 242 242 242 241 242 243 243 242 248 248 248 248 248
 248 248 247 247 247 247 247 247 248 248 249 250 249 249 249 249 250 250
 252 255 256 256]
'''
# 我的图片尺寸为256x256,如果两个二维列表相同,此处输出的列表里应全为256.

这是否意味着前后两次验证用的imageids顺序不一致?


补充:我后面发现还有一个pkl文件./fcn_unets5os16_spider_ep20/configs/fcn_unets5os16_spider.py.pkl,但是从该文件所在的目录来看这个pkl文件里保存的应该是模型的配置,和imageid没关系。

from sssegmentation.

123AOQW avatar 123AOQW commented on May 30, 2024

我的数据集中的验证集的imageid标号范围是2400~2849,一共480张图片。虽然图片编号如此,但验证集的图片并不是从训练集中抽取的。

from sssegmentation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.