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

AttributeError: module 's2cnn.utils' has no attribute 'cuda' #26

Open
zhixuanli opened this issue Aug 28, 2018 · 5 comments
Open

AttributeError: module 's2cnn.utils' has no attribute 'cuda' #26

zhixuanli opened this issue Aug 28, 2018 · 5 comments

Comments

@zhixuanli
Copy link

zhixuanli commented Aug 28, 2018

I'm trying to modify the train.py of shrec17 example to multi-gpu version.

Here's the code:

loader = importlib.machinery.SourceFileLoader('model', os.path.join(log_dir, "model.py"))
mod = types.ModuleType(loader.name)
loader.exec_module(mod)
model = mod.Model(60)  
if os.path.exists("./my_run/"+mode+"_"+"state.pkl"):
        model.load_state_dict(torch.load("./my_run/"+mode+"_"+"state.pkl"))
        print("Loading pkl successfully!!!!")
model.cuda()
logger.info("{} paramerters in total".format(sum(x.numel() for x in model.parameters())))
logger.info("{} paramerters in the last layer".format(sum(x.numel() for x in model.out_layer.parameters())))
bw = model.bandwidths[0]

I don't know whether s2cnn is supporting multi-gpu now, but this error AttributeError: module 's2cnn.utils' has no attribute 'cuda' occured when I run the following command: CUDA_VISIBLE_DEVICES=7,6,5,4 python train.py --model_path model.py --log_dir my_run --mode train --batch_size 72 --learning_rate 0.01 --augmentation 5 --num_workers 1 --evalutation cv

Could you please give me some help, thank you so much!!!!
@mariogeiger @tscohen @jonas-koehler

@zhixuanli
Copy link
Author

In s2cnn/soft/s2_fft.py
I moved import s2cnn.utils.cuda as cuda_utils from line 42 to line 7, and the problem was solved.

But while training, the average loss keeps increase and the average acc keeps decrease.
I used the state.pkl from single gpu, maybe it's not suitable for multi-gpu to initialize with it.

@mariogeiger
Copy link
Collaborator

I have no idea

@zhixuanli
Copy link
Author

zhixuanli commented Oct 10, 2018

@mariogeiger Apart from the ring like convolution kernel used here, is it possible for another form's kernel to get better performance?

@mariogeiger
Copy link
Collaborator

Ring like kernels giving better performance than near identity kernel is only an observation done with shrec17 experiment.
It might be that there is an even better kernel form for this dataset.
And I also think that the ideal kernel form depends on the dataset.

@zhixuanli
Copy link
Author

@mariogeiger Thank you for replying me. I just find that the ring like kernel will occupy too much RAM and may be a smaller kernel could be considered such as one quarter sphere.

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

2 participants