'str' object has no attribute 'decode'

Installing and setting up FaceSwap


Forum rules

Read the FAQs and search the forum before posting a new topic.

Please mark any answers that fixed your problems so others can find the solutions.

Post Reply
User avatar
Ling
Posts: 4
Joined: Thu Jan 13, 2022 3:26 am
Has thanked: 2 times

Successful installation, not running/opening

Post by Ling »

After installing Faceswap successfully, when I double the shortcut, the command prompt window popped and closed, nothing happened. I go to check some posts and FAQ, following some solutions, update MS Visaul C++, remove all cuda, conda, and python app, update nvidia driver, and then reinstall Faceswap, same.
My hardware/OS setting is AMD Ryzen 5 3600, 32GB ram, Nvidia GTX1070 8GB, windows 10 Home.

Anyone has some idea to resolve the issue?

Thanks.

Updates:

I copid the bat file content and run it in the command line, here's what I got:

Image


User avatar
lhchsqwct
Posts: 2
Joined: Thu Jan 13, 2022 10:18 pm
Been thanked: 1 time

'str' object has no attribute 'decode'

Post by lhchsqwct »

After executing the batch file, the GUI won't start and directly close.

Code: Select all

C:\Users\Administrator>"C:\Users\Administrator\Miniconda3\scripts\activate.bat" && conda activate "faceswap" && python "C:\Users\Administrator\faceswap/faceswap.py" gui
Setting Faceswap backend to NVIDIA
Traceback (most recent call last):
  File "C:\Users\Administrator\faceswap/faceswap.py", line 6, in <module>
    from lib.cli import args as cli_args
  File "C:\Users\Administrator\faceswap\lib\cli\args.py", line 22, in <module>
    _GPUS = GPUStats().cli_devices
  File "C:\Users\Administrator\faceswap\lib\gpu_stats.py", line 78, in __init__
    self._driver = self._get_driver()
  File "C:\Users\Administrator\faceswap\lib\gpu_stats.py", line 273, in _get_driver
    driver = pynvml.nvmlSystemGetDriverVersion().decode("utf-8")
AttributeError: 'str' object has no attribute 'decode'

User avatar
bryanlyon
Site Admin
Posts: 683
Joined: Fri Jul 12, 2019 12:49 am
Answers: 42
Location: San Francisco
Has thanked: 3 times
Been thanked: 165 times
Contact:

Re: 'str' object has no attribute 'decode'

Post by bryanlyon »

This seems to have just started hapenning. Please try the following to get us the information we need to troubleshoot this issue.

From inside your virtual environment, inside your faceswap folder, run:

Code: Select all

python -c "from lib.sysinfo import sysinfo ;  print(sysinfo)"

User avatar
lhchsqwct
Posts: 2
Joined: Thu Jan 13, 2022 10:18 pm
Been thanked: 1 time

Re: 'str' object has no attribute 'decode'

Post by lhchsqwct »

It's solved, I removed all the .decode("utf-8") field and it works now, I think it's trying to decode the already decoded part.


User avatar
bryanlyon
Site Admin
Posts: 683
Joined: Fri Jul 12, 2019 12:49 am
Answers: 42
Location: San Francisco
Has thanked: 3 times
Been thanked: 165 times
Contact:

Re: 'str' object has no attribute 'decode'

Post by bryanlyon »

The problem is some lib has changed or you have installed the wrong one. We need to see what's causing the problem, so please give that sysinfo.


User avatar
cagonzon
Posts: 4
Joined: Sun Jan 02, 2022 4:38 am
Has thanked: 1 time
Been thanked: 1 time

Re: 'str' object has no attribute 'decode'

Post by cagonzon »

I tried to get it for you, as I'm running into the same thing, but I got this message:

Attachments
Screenshot 2022-01-14 110759.jpg
Screenshot 2022-01-14 110759.jpg (23.67 KiB) Viewed 121 times

User avatar
Ling
Posts: 4
Joined: Thu Jan 13, 2022 3:26 am
Has thanked: 2 times

Re: 'str' object has no attribute 'decode'

Post by Ling »

lhchsqwct wrote: Fri Jan 14, 2022 1:32 am

It's solved, I removed all the .decode("utf-8") field and it works now, I think it's trying to decode the already decoded part.

I tried this and I can make it run now, thanks!


User avatar
bryanlyon
Site Admin
Posts: 683
Joined: Fri Jul 12, 2019 12:49 am
Answers: 42
Location: San Francisco
Has thanked: 3 times
Been thanked: 165 times
Contact:

Re: 'str' object has no attribute 'decode'

Post by bryanlyon »

lhchsqwct wrote: Fri Jan 14, 2022 1:32 am

It's solved, I removed all the .decode("utf-8") field and it works now, I think it's trying to decode the already decoded part.

Don't do this, it prevents updates.

This however should now be fixed. Torzdf had pushed a fix. Just reinstall to pull it and it should be fixed.


Post Reply