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

Minor modifications to run locally + comments for explanation #1

Merged
merged 2 commits into from
Sep 15, 2023

Conversation

jjc10
Copy link
Collaborator

@jjc10 jjc10 commented Sep 15, 2023

Minor changes to have this run locally (for instance removed num_workers) on dataloaders which don't work for us (or at least seem to slow things down a lot since we're running this on a single machine).

To run the code:

python train_cifar100.py --data-root data/cifar10 --dataset cifar10 --result_dir results/msdnet_ge_cifar10 --arch msdnet_ge --ensemble_reweight 0.5 --batch-size 64 --nBlocks 10 --stepmode even --step 2 --base 4 --nChannels 16 --workers 1 --lr_f 0.1 --lr_milestones 150,225 --epochs 200 --weight-decay 1e-4

Also when running this we will likely run into an issue with tensorboard pytorch/pytorch#69894.

The file to fix is: site-packages/torch/utils/tensorboard/__init__.py
To get the exact location, activation your environment, start a python shell, import torch and print(torch.file)

The fix is to use proper import syntax for LooseVersion
The file should look like this:

import tensorboard
from distutils.version import LooseVersion


if not hasattr(tensorboard, '__version__') or LooseVersion(tensorboard.__version__) < LooseVersion('1.15'):
    raise ImportError('TensorBoard logging requires TensorBoard version 1.15 or above')


del LooseVersion
del tensorboard

from .writer import FileWriter, SummaryWriter  # noqa: F401
from tensorboard.summary.writer.record_writer import RecordWriter  # noqa: F401

@jjc10 jjc10 merged commit 281c16f into main Sep 15, 2023
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

Successfully merging this pull request may close these issues.

1 participant