Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with pcLines #52

Open
ramiel opened this issue Jul 14, 2019 · 2 comments
Open

Error with pcLines #52

ramiel opened this issue Jul 14, 2019 · 2 comments
Assignees
Labels
bug Something isn't working validation

Comments

@ramiel
Copy link

ramiel commented Jul 14, 2019

I have this code

const sess = new gm.Session();
const input = await gm.imageTensorFromURL(
  '/image.jpg',
  'uint8',
  [width, height, 4],
  true
);

let operation = gm.grayscale(input);
operation = gm.downsample(input, 2, 'max');
operation = gm.gaussianBlur(input, 30, 1);
operation = gm.dilate(input, [3, 3]);
operation = gm.adaptiveThreshold(input, 3, 5);
operation = gm.sobelOperator(input);
operation = gm.cannyEdges(input, 0.8, 1);
operation = gm.pcLines(input, 10, 2, 2);

const output = gm.tensorFrom(operation);
sess.init(operation);
sess.runOp(operation, 0, output);

if I run this code I get the error Tensor: Shape is not valid.

If I change the output to be const output = gm.tensorFrom(input); I get the error KernelConstructor: Constant W, has invalid type "number".

None of these errors happen if I remove the pcLines call. What can be the cause?

@WorldThirteen
Copy link
Contributor

WorldThirteen commented Jul 14, 2019

@ramiel, thanks for pointing on this. There is an error when gm.pcLines layersCount argument (second) is too high. We will enhance the input validation soon.
For your code, you could reduce the layersCount of pcLines up to 1-3.

operation = gm.pcLines(input, 1, 2, 2);

@WorldThirteen WorldThirteen added bug Something isn't working validation labels Jul 14, 2019
@WorldThirteen WorldThirteen self-assigned this Jul 14, 2019
@ramiel
Copy link
Author

ramiel commented Jul 15, 2019

Ok, thank you. I'll try and I'll let you know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working validation
Projects
None yet
Development

No branches or pull requests

2 participants