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

IndexError when plotting 2D plots #32

Open
seanswyi opened this issue Apr 30, 2021 · 3 comments
Open

IndexError when plotting 2D plots #32

seanswyi opened this issue Apr 30, 2021 · 3 comments

Comments

@seanswyi
Copy link

I currently downloaded the provided models and am running the command:

python plot_surface.py \
    --cuda \
    --model resnet56 \
    --x=-1:1:51 \
    --y=-1:1:51 \
    --model_file cifar10/trained_nets/resnet56_sgd_lr=0.1_bs=128_wd=0.0005/model_300.t7 \
    --dir_type weights \
    --xnorm filter \
    --xignore biasbn \
    --ynorm filter \
    --ignore biasbn \
    --plot

and am getting the following error at net_plotter.set_weights:36: IndexError: invalid index to scalar variable.

Checking the value of step shows that it's -1.0 and since we cannot index scalar values I'm assuming this is the problem. Am I running something wrong, or is this a bug?

Granted, I'm not using MPI. Could that be the cause of the issue?

Thanks.

@henryp12345
Copy link

I'm having this same issue and I am using MPI, so that's not the issue. Did you manage to resolve this?

@seanswyi
Copy link
Author

@henryp12345 No, I haven't. Granted, I haven't really spent a lot of time tryin to debug or solve the issue though.

@AlbertiPot
Copy link

I currently downloaded the provided models and am running the command:

python plot_surface.py \
    --cuda \
    --model resnet56 \
    --x=-1:1:51 \
    --y=-1:1:51 \
    --model_file cifar10/trained_nets/resnet56_sgd_lr=0.1_bs=128_wd=0.0005/model_300.t7 \
    --dir_type weights \
    --xnorm filter \
    --xignore biasbn \
    --ynorm filter \
    --ignore biasbn \
    --plot

and am getting the following error at net_plotter.set_weights:36: IndexError: invalid index to scalar variable.

Checking the value of step shows that it's -1.0 and since we cannot index scalar values I'm assuming this is the problem. Am I running something wrong, or is this a bug?

Granted, I'm not using MPI. Could that be the cause of the issue?

Thanks.

Hi, I have encountered this issue too. Sooner I found that this is because I have stored an h5 file holding a single direction in the last run, so it may conflict with the next run which tries to plot two directions. When I delete all the cached h5 files and re-run, the issues do not happen.

may it help

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

3 participants