Tensorboard Pytorch does not show runs - pytorch

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!!

Related

OpenCV-Python: cv2.imshow doesn't stop working

I wrote simple program just to try to open photo using cv2.imshow():
import cv2
img = cv2.imread('images/8d47d369_2022-10-06_18-18-30_0.jpg')
print(img)
if img is None:
raise RuntimeError('Could not read image')
cv2.imshow('Original image', img)
cv2.waitKey(0)
But I it didn't work. The window with photo doesn't open, and script doesn't stop too. I need to terminate it, or it just runs without any result and without errors.
I tried different things:
I remover cv2.waitKey(0), resut the same. Also, I tried to print(cv2.imread()), and it showed numpy ndarray as expected. So, this command work normally.
I created new venv and install opencv-python there, doesn't work either.
I tried to start this script in PyCharm, VSCode and Jupyter Notebook. The same problem in PyCharm and VSCode, in Jupyter Notebook kernel just died.
I used opencv before, and have another jupyter notebooks with it. All of them now doesn't work either.
I think that root of this problem in installation of opencv-python, maybe there are problems with packages, which important for OpenCV work, but I didn't find information about it. Hope that someone will help me with this problem!
My OS is Ubuntu 18.04.

Program failing to load image

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.

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.

Microsoft LayoutLM model error with huggingface

I was trying to utilize the https://github.com/microsoft/unilm/tree/master/layoutlm for document classification purpose, but was constantly getting "OSError: Unable to load weights from pytorch checkpoint file."
Can someone help me to run and work with layoutLM.
Configuration/Versions:
Windows 10
Python - 3.6.5
huggingface-transformers - 3.1.0
pytorch - 1.5.0
tensorflow - 2.3.1
command to run the code:
python run_classification.py --data_dir C:\Users\Downloads\unilm-master\unilm-master\layoutlm\examples\classification\data --model_type layoutlm --output_dir C:\Users\Downloads\unilm-master\unilm-master\layoutlm\examples\classification\data --do_eval --model_name_or_path
I believe there are some issues with the command --model_name_or_path, I have tried the above method and tried downloading the pytorch_model.bin file for layoutlm and specifying it as an argument for --model_name_or_path, but of no help.
C:\Users\Downloads\unilm-master\unilm-master\layoutlm\examples\classification\model\pytorch_model.bin.
And also I doubt if it is because of the discrepancy between Transformer's support and layoutlm support (related to the version of tranformers 3.1.0 or 2.0.0)?
Can someone help me get up to speed with layoutLM.
Help is appreciated.

Keras CNTK stops working when I train the model

I have changed keras backend to "cntk" in keras.json file.
When I execute my python file execute
it stops working.
stop-working image
But when I use tensorflow/theano is working normally.
Why?
----------update
image-pycharm
When pycharm Found images(image-pycharm) ,it stop suddenly.
And then I try to use cmd to execute my python file.
The result is "The system stop working"

Resources