HamishGBrown / py_multislice

A GPU accelerated Python multislice slice code
24 stars 16 forks source link

Problem when trying to run demo on HR-TEM notebook #4

Closed Espendb closed 2 years ago

Espendb commented 3 years ago

Hi Hamish I was trying to run the tutorial / example HR-TEM notebook. I have, however, run into some problems. Not sure if this has anything to do with me lacking the FAC or some other issues. I am woking on a Mac (big sur). Let me know what sort of info you need from me.

Screenshot 2021-04-07 at 15 40 57
HamishGBrown commented 3 years ago

Hi @Espendb, the problem is forward compatibility with pytorch newer version from 1.6 onward have a whole fft module (so torch.fft is a module) whilst the older versions of pytorch just had fft and ifft functions called via torch.fft and torch.ifft. I'll try think of a quick fix for this but I might have to rework the code a bit to work with the newest pytorch

HamishGBrown commented 3 years ago

If you could try downgrading your pytorch to 1.2.0 it might be made to work

Espendb commented 3 years ago

Thanks @HamishGBrown - this worked like a charm. I can now run the tutorial without any issues. Will try it out on "a real " structure next :)

AndrewHerzing commented 2 years ago

Are there any plans to make the code compatible with newer versions of PyTorch? I am having difficulty running v1.2.0 with my hardware.

HamishGBrown commented 2 years ago

@AndrewHerzing, I've already begun work on readying the code for pytorch 1.8 onward. I'll have a few days to spend on it in the coming weeks but the project has turns out to be a little larger than I first perceived.

AndrewHerzing commented 2 years ago

That is excellent news. Please let me know if there is any way I can help via testing, etc.

HamishGBrown commented 2 years ago

@AndrewHerzing, @Espendb I have a version of py_multislice that runs with pytorch 1.8. Still working on one or two niggling bugs but it passes all the tests and runs all the notebooks. Would you be interested in trying it? The ionization workflows are still to be updated since the FAC code changed under my feet and i'm likely to just copy what abTEM did and go with GPAW instead. Apologies if that was the feature you were after.

DISORDER-Espen commented 2 years ago

Hi @HamishGBrown (Different username due to starting my own research group :) ) Anyway, would be interested in trying it for sure.

AndrewHerzing commented 2 years ago

Yes, absolutely.

HamishGBrown commented 2 years ago

I've just pushed the master branch. I've tested on pytorch 1.7,1.8 and 1.10 and even works on a GTX 3090 now. Let me know how you go.

HamishGBrown commented 2 years ago

Closing this issue, but feel free to reopen if the fix turns out to be specific to the systems I've used.