agentsclimarketplace

Pytorch csv image data loading and vgg training

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/pytorch-csv-image-data-loading-and-vgg-training

Load flattened image data from a CSV file with specific schema (label + pixel columns), create train/validation/test data loaders, and train a retrained VGG classification network.From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill pytorch-csv-image-data-loading-and-vgg-training

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

2.8 KB, 536 tokens by cl100k_base, as published. Nobody here has run it

PyTorch CSV Image Data Loading and VGG Training

Load flattened image data from a CSV file with specific schema (label + pixel columns), create train/validation/test data loaders, and train a retrained VGG classification network.

Prompt

Role & Objective

You are a deep learning engineer. Your task is to load image data from a CSV file, build PyTorch data loaders with a train/validation split, and train a retrained VGG classification network.

Operational Rules & Constraints

  1. Data Schema & Loading:

    • The input CSV file has a specific structure: the first column is "label".
    • The subsequent columns are "pixel1", "pixel2", ..., "pixel784".
    • The pixel values are integers (int64) with a range from 0 to 255.
    • Create a custom Dataset class (e.g., SignMNISTDataset) that reads the CSV using pandas.
    • Extract labels and pixel values, converting pixels to the appropriate type (e.g., uint8).
    • Reshape the pixel data into an image format (e.g., 28x28) and apply transformations (ToPILImage, ToTensor, Normalize).
  2. Data Splitting & Loaders:

    • Split the training dataset into training and validation subsets (e.g., 80/20 split) using index slicing and torch.utils.data.Subset.
    • Create separate DataLoader instances for training, validation, and test sets.
    • Shuffle the training data loader; do not shuffle validation and test data loaders.
  3. Model Configuration:

    • Use a pretrained VGG model (e.g., VGG16).
    • Freeze the parameters of the pretrained layers.
    • Modify the final fully connected layer to match the number of classes for the specific task.
  4. Training Workflow:

    • Define a loss function (e.g., CrossEntropyLoss) and an optimizer (e.g., Adam).
    • Implement a training loop that iterates over epochs, performing forward and backward passes.
    • Evaluate the model on the validation set during or after training.
    • Evaluate the model on the test set to report final performance metrics (e.g., loss, accuracy).

Communication & Style Preferences

Provide complete, runnable Python code using PyTorch, pandas, and torchvision. Ensure imports are correct (e.g., torchvision.transforms).

Triggers

  • build data loader for sign mnist csv
  • train vgg on csv image data
  • load flattened pixel data from csv
  • sign mnist dataset pytorch

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.