YeeHoran / Personality-disentangled-FER

1 stars 0 forks source link

spyder collapse #3

Open YeeHoran opened 1 year ago

YeeHoran commented 1 year ago

When I debug common FER code, using the face embedding module from DeepFace as the network structure and use it as initialization, the spyder collapse when I begin to work one day. I tried many ways to downgrade or upgrade spyder version, but no help! So it's time to reinstall Anaconda.

The steps are as follows,

  1. follow the step from: https://phoenixnap.com/kb/how-to-install-anaconda-ubuntu-18-04-or-20-04#:~:text=Steps%20For%20Installing%20Anaconda.%201%20Step%201%3A%20Update,5%20Step%206%3A%20Activate%20and%20Test%20Installation.%20 /
  2. After the command : conda info, it shows the following info and they are presented here for other related future installation reference. (base) yi@Yi:~/Documents/2. Software$ conda info

    active environment : base active env location : /home/yi/anaconda3 shell level : 1 user config file : /home/yi/.condarc populated config files : /home/yi/.condarc conda version : 23.1.0 conda-build version : 3.23.3 python version : 3.10.9.final.0 virtual packages : __archspec=1=x86_64 cuda=11.7=0 glibc=2.31=0 linux=5.15.0=0 unix=0=0 base environment : /home/yi/anaconda3 (writable) conda av data dir : /home/yi/anaconda3/etc/conda conda av metadata url : None channel URLs : https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /home/yi/anaconda3/pkgs /home/yi/.conda/pkgs envs directories : /home/yi/anaconda3/envs /home/yi/.conda/envs platform : linux-64 user-agent : conda/23.1.0 requests/2.28.1 CPython/3.10.9 Linux/5.15.0-69-generic ubuntu/20.04.3 glibc/2.31 UID:GID : 1000:1000 netrc file : None offline mode : False

YeeHoran commented 1 year ago

The former section shows how to reinstall Anaconda, and this section will show how to install tensorflow with Anaconda:

  1. Follow the steps in the website: https://docs.anaconda.com/anaconda/user-guide/tasks/tensorflow/ However, when running 'import tensorflow' or 'import tf', it still shows that they can't be found.
  2. Then, try the 2nd method following: https://bobbyhadz.com/blog/python-no-module-named-tensorflow#:~:text=The%20Python%20%22ModuleNotFoundError%3A%20No%20module%20named%20%27tensorflow%27%22%20occurs,module%20by%20running%20the%20pip%20install%20tensorflow%20command. And only the first command in the guide 'pip install tensorflow' is carried out, then it is installed and when running 'import tensorflow' it never indicate error any more.
YeeHoran commented 1 year ago

Then, it indicates that 'torchvision' is not available. This is solved by running the cmd of 'pip install torchvision'.

Next, when running the code, it indicates that 'deepface' is not available. This is solved by running the cmd 'pip install deepface'.

In addition, when go on running it, it shows the following error, and will be solve next time.

File ~/Documents/1. Research/1. FER project/2. FER codes/3. Deepface-based-20230124/7. identity disentangled FER/common FER-20230412.py:171 criterion=tf.Keras.losses.CategoricalCrossentropy()

AttributeError: module 'tensorflow' has no attribute 'Keras'