Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

overfitting #125

Open
MrLuer opened this issue Nov 1, 2020 · 1 comment
Open

overfitting #125

MrLuer opened this issue Nov 1, 2020 · 1 comment

Comments

@MrLuer
Copy link

MrLuer commented Nov 1, 2020

train acc near 1 but validation acc lower than 0.1

@MrLuer
Copy link
Author

MrLuer commented Dec 19, 2020

I find out what's wrong with it, not every class samples exist in train.list, in other words some calsses only exist in test.list. use python code below to generate train.list and test.list and replace the old one. you will get validation acc around 0.75-0.85

import os
import random
root = "D:/DataSets/UCF-101"

def get_img_list(path):
return [os.path.join(path,x) for x in os.listdir(path) ]

train = open("train.list",'w+')
test = open("test.list",'w+')
dirs = get_img_list(root)
for idx,dir in enumerate(dirs):
d = get_img_list(dir)
random.shuffle(d)

b =  0.2 * len(d)
for i in range(len(d)):
    print(d[i])
    if i < b:
        print("hell")
        test.write(d[i])
        test.write(" "+str(idx)+'\n')
    else:
       
        train.write(d[i])
        train.write(" "+str(idx)+'\n')
print(idx)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant