Skip to content
ProGamerGov edited this page May 17, 2017 · 8 revisions

Troubleshooting Permission Problems:


This issue can often occur on Amazon Web Services (AWS), and can be solved by using chmod like this:

chmod u+x ./lum-transfer.py

chmod u+x ./linear-color-transfer.py


Update:

I am currently testing a new branch of the code which will solve all the color space related issues. This branch can be selected through the normal way through Gitub's menus, or by this link: https://github.com/ProGamerGov/Neural-Tools/tree/Automatic-RGB-Conversion


Image Color Space Problems:


The image specified for the --target_image parameter, is not in the RGB color space:

Traceback (most recent call last):
  File "linear-color-transfer.py", line 67, in <module>
    output_img = match_color(target_img, source_img, mode=transfer_mode, eps=float(eps_value))
  File "linear-color-transfer.py", line 38, in match_color
    t = t.transpose(2,0,1).reshape(3,-1)
ValueError: total size of new array must be unchanged

The image specified for the --source_image parameter, is not in the RGB color space:

Traceback (most recent call last):
  File "linear-color-transfer.py", line 67, in <module>
    output_img = match_color(target_img, source_img, mode=transfer_mode, eps=float(eps_value))
  File "linear-color-transfer.py", line 42, in match_color
    s = s.transpose(2,0,1).reshape(3,-1)
ValueError: total size of new array must be unchanged

To fix either of these two issues, one can use ImageMagick like this:

convert problem_image.png -colorspace rgb fixed_image.png

Or you can use different software to change the problem image's color space.


The image specified for the --source_image parameter, has an "embedded color profile":

ubuntu@ip-Address:~/neural-style$ python linear-color-transfer.py --target_image target.png --source_image source.png --output_image output_pca.png
Traceback (most recent call last):
  File "linear-color-transfer.py", line 67, in <module>
    output_img = match_color(target_img, source_img, mode=transfer_mode, eps=float(eps_value))
  File "linear-color-transfer.py", line 62, in match_color
    matched_img += mu_s
ValueError: operands could not be broadcast together with shapes (2000,2000,3) (4,) (2000,2000,3)
ubuntu@ip-Address:~/neural-style$

The image specified for the --target_image parameter, has an "embedded color profile":

ubuntu@ip-Address:~/neural-style$ python linear-color-transfer.py --target_image target.png --source_image source.png --output_image output_pca.png
Traceback (most recent call last):
  File "linear-color-transfer.py", line 67, in <module>
    output_img = match_color(target_img, source_img, mode=transfer_mode, eps=float(eps_value))
  File "linear-color-transfer.py", line 62, in match_color
    matched_img += mu_s
ValueError: operands could not be broadcast together with shapes (2948,1944,4) (3,) (2948,1944,4)
ubuntu@ip-Address:~/neural-style$