Skip to content

loaded 0 images training from colab. #28

@danielsoy

Description

@danielsoy

I coud train and evaluate the generated model for the MVTec hazelnut class dataset in my
PC, by erasing the rest of the classes in all_types = , and just let : all_types = ['hazelnut']
inside run_training.py, and eval.py.
Being my path to hazelnut this:
C:\Users\libro\pytorch-cutpaste\Data\hazelnut.

Then i was trying to execute run_training.py from googles colab, to speed up
the training cause i have no GPU, but run_training.py, can not find the images.

Already tried two aproches to upload the Data folder to colab:
1_Uploaded that folder as is in my PC, to my goggle drive C: path.
2_ forked your repository, and added the Data/hazelnut etc folders to my version of your repository .

I can see my pictures at colab in: /content/pytorch-cutpaste/Data/hazelnut/train/good
when i clone my repo version.

And at: /content/drive/MyDrive/Data/hazelnut/train/good when I clone your repo original version .

In both cases i got this errror:

!python run_training.py --model_dir models --head_layer 2
Namespace(type='all', epochs=256, model_dir='models', pretrained=True, test_epochs=10, freeze_resnet=20, lr=0.03, optim='sgd', batch_size=64, head_layer=2, variant='3way', cuda=False, workers=8)
using device: cpu
training hazelnut
loading images
loaded 0 images

I was lucky reading and saveing one picture from hazelnut....good folder in colab
by adding this to dataset.py to be sure that i was able to access to the good folder
that is needed during training.
###################################################################
import cv2

root_dir = "/content/drive/MyDrive/Data"
img = cv2.imread(root_dir + "/hazelnut/train/good/aume0.PNG")
cv2.imwrite(root_dir + "/hazelnut/train/good/saveit!.PNG", img)

root_dir1 = "/content/pytorch-cutpaste/Data"
img1 = cv2.imread(root_dir + "/hazelnut/train/good/aume1.PNG")
cv2.imwrite(root_dir1 + "/hazelnut/train/good/saveit1!.PNG", img1)
####################################################################
How can I to make dataset.py, to retrieve my pictures from colab, being MyDrive, the
favorite option?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions