Skip to main content

Posts

Showing posts from April, 2021

VS Code

 After opening output window Select default profile to command prompt add anaconda to path env varibles Example: C:\Anaconda3\condabin

Open ipynb on double click

 https://axil.github.io/how-to-open-ipynb-file-with-one-doubleclick-on-windows.html Can install this inside conda env: pip install nbopen python -m nbopen.install_win This will reuse existing jupyter server if possible (=if it is already launched in the same dir). Then two options: (I did the second) Run this command in cmd.exe under administrator privileges: assoc .whl=jupyter& ftype jupyter=cmd.exe /c jupyter-notebook "%1" Alternatively, a slightly different line can be copied into a assoc_ipynb.bat file and executed through 'Run as administrator': assoc .whl=jupyter& ftype jupyter=cmd /c jupyter-notebook "%%1" PS jupyter-notebook.exe is assumed to be in the PATH. to close open notebooks open conda prompt any env jupyter notebook list jupyter notebook stop 8888

3D Animation Matlab

 import matplotlib.pyplot as plt import matplotlib.animation as animation %matplotlib inline fig = plt.figure(dpi=200) ims = [] for t in range(0, img1.shape[0]):     imx = img1[t,:,:]     im = plt.imshow(imx, cmap='gray', animated=True)     ims.append([im]) ani = animation.ArtistAnimation(fig, ims, interval=200, blit=True,                                 repeat_delay=1000) plt.close() from IPython.display import HTML HTML(ani.to_jshtml()) # if you want to keep inside function you can use display(HTML(ani.to_jshtml())) Example: def playVideo(input_sample):     numFrames = input_sample.shape[0]     fig = plt.figure()     fig.set_size_inches(10, 10, True)     im = plt.imshow(input_sample[0,:,:])     plt.close()     def update(i):         img = input_sample[i,:,:]         im.set_data(img)         return im     ani = animation.FuncAnimation(fig, update, frames=numFrames, repeat=True)       # display(HTML(ani.to_html5_video()))     display(HTML(ani.to_jshtml())) logger.info('Savi

Tensorflow and Pytorch for Cuda 10.0

And about the cuda, I believe you are setting up for Cuda 10.0 right? If that's the case I think the steps would be to install VS 2017, then CUDA and then download CUDNN (of compatible version) and copy it to the CUDA folder. also you might need to add cuda dir to system paths after copying cudnn. For, VS 2017 - tensorflow_gpu-1.15.0 cuDNN=7.4 CUDA=10 VS 2017: https://download.visualstudio.microsoft.com/download/pr/010d871e-3fa8-4004-b219-1c10bcaa71ad/a3ee8ecda3f9cc003dfe40db87eb56d38b21087116f51e243ab0455348f4b188/vs_Community.exe CUDA: https://developer.nvidia.com/compute/cuda/10.0/Prod/network_installers/cuda_10.0.130_win10_network CuDNN: https://developer.nvidia.com/cudnn Download cuDNN v7.6.5 (November 5th, 2019), for CUDA 10.0 Then: conda create -n iq42mas python=3.6.5 conda install -c anaconda cudatoolkit=10.0 pip install tensorflow-gpu==1.15 conda install pytorch==1.2.0 torchvision==0.4.0 cudatoolkit=10.0 -c pytorch