0

Part 1:

I'm using the Cognitive Face API in my Python project for image editing, but I'm encountering an error when running my script
python3 edit_cli.py --input imgs/example.jpg --output imgs/output.jpg --edit "turn him into a cyborg".
The error message I receive is:
Error when calling Cognitive Face API: status_code: 401, code: 401, message: Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource.
I've double-checked my subscription key and the API endpoint, and both seem to be correct. However, the error persists.

I'm seeking advice on how to troubleshoot this issue and ensure my Face API calls are successful. Any help would be greatly appreciated.

Part 2:

I'm working on a Python project and facing an issue with module imports. When executing my image editing script
python3 edit_cli.py --input imgs/example.jpg --output imgs/output.jpg --edit "turn him into a cyborg",
I encounter the error
ModuleNotFoundError: No module named 'ldm.models'; 'ldm' is not a package.
The ldm.models module does exist, but it's under stable_diffusion. I tried updating the import statement to import stable_diffusion.ldm.models, but the error persists. The parent directory of stable_diffusion is included in my PYTHONPATH. The directory structure is as follows: my_project_folder -> stable_diffusion -> ldm -> models -> some_model.py. Even when trying to import with from stable_diffusion.ldm.models import SomeClass, the error still occurs.

Any assistance in understanding and rectifying this import error would be greatly appreciated.

greybeard
  • 2,249
  • 8
  • 30
  • 66

0 Answers0