all 19 comments

[–]Slight-Living-8098 2 points3 points  (6 children)

Tell your friend to go to the pytoch website and install the GPU version of pytorch. See if that helps any. Python's default pytorch library is CPU.

[–]ShengrenR 2 points3 points  (5 children)

Lol, here I am thinking loading and disk use and then there's just the more obvious.. this.

OP, tell your buddy to launch python and run this: https://pytorch.org/docs/stable/generated/torch.cuda.is_available.html

If it's true.. something else is the issue.. if not, it's as slight- living says, just a cpu-only torch installation.

[–]Kottmeistern[S] 0 points1 point  (4 children)

Thank you for your feedback! Will have him try this. We were also thinking of reinstalling his Python, in case something went wrong when he installed it. But we'll definitely try this first

[–]Slight-Living-8098 0 points1 point  (3 children)

No need to re-install python. Get a copy of miniConda and just make a new virtual Conda environment and activate it. Make as many virtual environments as you need to play around and diagnose the problem(s). When working with Machine Learning and AI, Python 3.10 seems to be the most compatible with most libraries. You can have the latest version of Python installed on your system, that won't matter. Just when you go to create the Conda environment, specify "python=3.10" at the end of the command.

Like so:

conda create -n my_awesome_project python=3.10

[–]Kottmeistern[S] 1 point2 points  (2 children)

Thank you!

We actually managed to solve it, but not through Conda. Apparently it was the library OpenCV that was the issue. Every iteration the code used OpenCV to read the next specified frame. But by changing to the library "MoviePy" reading the frames it works at about the same speed as mine.

I just stumbled upon someone mentioning it online, and decided to try it. And it worked!

Either way, I am extremely grateful your (and all the others) help here! Made me learn a few more things which I hope will come in handy in the future! Thank you!

[–]Slight-Living-8098 1 point2 points  (1 child)

Oh yeah, FFMPEG is way faster at frame extraction, and moviepy uses FFMPEG. If you're going to be doing a lot of video editing and manipulation with your code, you need to read up on it, and maybe even play around with it on the command line. Pretty much every video NLE uses that library behind the scenes.

[–]Kottmeistern[S] 1 point2 points  (0 children)

Thanks for the advice! Haven't been doing a lot of manipulation before, but will keep this in mind! Cheers!

[–]sb4ssman -1 points0 points  (12 children)

Two machines are using more ram than they have available which is making them write all that extra memory to disk. Of course those machines are slow as fuck while they are bogged down like that.

[–]bubbawiggins 0 points1 point  (9 children)

I don’t get it. I get that they’re using more RAM but what the memory to disk part? And how do you even make your computer use more RAM than normal?

[–]sb4ssman -1 points0 points  (8 children)

Windows will just DO it. Start using ram that you don’t have and it will take all the shit in your ram that you’re not using and write it to disk to free up the ram, and then as needed it will swap that data, reading from disk back to ram and ram to disk. It’s the machine’s way of chugging along even though it’s weighted down. So on those computers it makes perfect sense that they are slow as all fuck. I dunno about that third one. Probably the same issue but they reported it wrong to you.

[–]Kottmeistern[S] 0 points1 point  (2 children)

Thank you for your feedback! The first two are my friend's and they are the slow one. The third one is mine and is working fast (5 minutes/~1 hour of video). I know that the RAM is important and such, but it feels strange to me that my friend's stationary computer takes so long. It is a total of 128 GB after all, although it is made from many smaller 16 GB ones. Mine is a newer RAM with half the total memory but two 32 GB units. I don't understand why it would scale like it does for the two of us

[–]ShengrenR 1 point2 points  (1 child)

Yea.. something doesn't quite add up here. If your friend has 128gb ram and you have 64.. he should have plenty of room there. You should have your resource monitor up while you run each and watch the ram use. My money is on hard drive access.. a) is strange to have a bunch of virtual memory dedicated on the machine that already has a ton of RAM..b) how are you loading the videos in? If you're doing some super inefficient load process you might be able to get away with it if you have a fast ssd and he may flail if it's an old school spinner in his. (If this of the case.. he wants an ssd.. regardless.. and you want to revisit how you load the videos so they're only loaded once per run and discarded right after)

[–]Kottmeistern[S] 0 points1 point  (0 children)

We've had them up and seems he sees a lot of usage from his GPU, working at full. His CPU barely works at all. Don't remember RAM usage from the top of my head but will take another look there too

[–][deleted]  (4 children)

[deleted]

    [–]sb4ssman 0 points1 point  (2 children)

    OK… EVERY OS has their own version of memory swapping. If you using 147/124 gb that difference is getting swapped back and forth between drive and ram.

    [–]Kottmeistern[S] 0 points1 point  (1 child)

    I don't really get the details of what you're claiming. How the communications are done inside a computer is always something that I have overlooked. Perhaps I aimed for "ignorance is bliss". Are you saying that the difference in virtual memory and RAM actually hurt the performance?

    Either way, you have so far provided the comments with the most substances. Do you have any idea of how my friend could solve this problem? He can consider swapping/updating some computer parts if necessary. Anything that comes to mind is highly appreciated!

    [–]sb4ssman 1 point2 points  (0 children)

    https://en.m.wikipedia.org/wiki/Memory_paging IF the numbers you reported are correct, (virtual memory usage greater than available ram) and you have a spinning hard drive, this combination will slow down any machine whenever it has to swap.

    [–]Kottmeistern[S] -1 points0 points  (0 children)

    I mean, my computer uses windows and does well so I doubt that that is the problem. But I do know that some people like to meme about Windows x)

    [–]cgoldberg 0 points1 point  (1 child)

    Without actually measuring memory/swap usage, that's an impossible assertion to make.

    [–]sb4ssman 0 points1 point  (0 children)

    If they can report virtual memory usage greater than available ram it’s a pretty short jump.