Program failing to load image - pytorch

I am trying to convert MNIST images into tensors and when I run the program I am getting the following error. I tried to re-install PyTorch but it did not help.
UserWarning: Failed to load image Python extension: Could not find module
'C:\Users\---\AppData\Roaming\Python\Python39\site-packages\torchvision\image.pyd'
(or one of its dependencies). Try using the full path with constructor syntax.

Related

Tensorboard Pytorch does not show runs

I am new to tensorboard with Pytorch.
I followed the codes at https://pytorch.org/docs/stable/tensorboard.html
And it generates a folder accordingly
In the command line, I run
But at http://localhost:6006/, it does not load accordingly. It keeps loading but show
I tried to use "tensorboard dev upload --logdir 'runs'" as well.
But it still shows nothing.
No event file is found here.
I am using tensorboard 2.7.0, torch 1.7, cuda 11.0.
Can anyone give me some help? Thanks a lot!!

constant Download error trying to download mnist

The error keeps saying:
Downloading data from https://storage.googleapis.com/tensorflow/tf-keras-datasets/mnist.npz 16384/11490434 [..............................] - ETA: 10s
and keeps doing this continuously, The code I wrote is this:
import tensorflow as tf
(x_train, y_train), (x_test, y_test)= tf.datasets.mnist.load_data()
print(x_train[0])
I am trying to print the array of an image using this command, I know I can do it other ways, but I am trying to use "keras.datasets.mnist.load_data()" specifically. What does this error mean?
My tensorflow version is 2.6.1 and python is 3.9.7
The error is shown in the image:
Ok I figured out what went wrong, it is because the file was not downloading permanently in its folder using python's IDLE. When I had used Jupyter Notebook somehow it installed it permanently. In other words, after python's IDLE downloads the file, the downloading phase will stop and the file will go away and python will continuously keep trying to look for it inorder to completely execute the command. Since it could not, you can say python was chasing its tail.
If you were to manually download it and use the same command, python's IDLE will be able to use it. However if you messed with the manually downloaded file by changing the way the file should be opened and you use another command such as mnist.load_data("mnist"), you will have to find that file somehow like how I did, by downloading anaconda and using jupyter Notebook or something similar.
The reason why python's IDLE is doing that I have no clue, but if you can somehow find a way to install it permanently the program will work.

How can we fix :"could not initialize a memory descriptor, in file tensorflow/core/kernels/mkl_maxpooling_op.cc:578" error while using InceptionV3?

I am trying to train InceptionV3 on a dataset that I have.I am using python3.5 on spyder with keras and tensorflow as backend.
I am getting the following error:
could not initialize a memory descriptor, in file tensorflow/core/kernels/mkl_maxpooling_op.cc:578
I have tried installing tensor flow with conda install -c anaconda tensorflow but that didn't removed the error.

Joblib doesn't work in Jupyter lab

Firstly I use the joblib.dump command in my neural network training notebook, in order to dump my pipeline that is fitted on my input data:
joblib.dump(prepareinput, "prepareinput.save")
Then when I try to load the data in a different notebook in Jupyter lab using:
prepareinput = joblib.load('prepareinput.save')
It will return the following error:
No such file or directory: 'prepareinput.save'.
Whilst the file is present in the directory. Then when I export the notebook as script, it will run perfectly. I have also tried using the full path "~/..linktofile../prepareinput.save"
Does anyone have an idea on how to fix this issue?

Bazel extension file not found error when installing TensorFlow in python3?

I currently have an error while installing tensorflow with python 3. Previously I had successfully installed tensorflow with python 2, and that was after I commented out several sections for ios/android. I decided to copy over the exact tensorflow files that worked for the python 2, and reconfigured the settings to suit it for python 3. Is this correct? Because I figured the configurations would be overwritten if I reconfigure the same files, and the edited files I require for TensorFlow to work will still be present.
Here is my error code:
error loading package 'bazel-tensorflow/external/bazel_tools/tools/build_defs/docker/testdata': Extension file not found. Unable to load package for '//tools/build_defs/docker:docker.bzl': BUILD file not found on package path.

Resources