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

Allow Map Tiles to be evaluated #727

Closed
AmitMY opened this issue Mar 26, 2019 · 4 comments · Fixed by #733
Closed

Allow Map Tiles to be evaluated #727

AmitMY opened this issue Mar 26, 2019 · 4 comments · Fixed by #733
Assignees
Labels

Comments

@AmitMY
Copy link

AmitMY commented Mar 26, 2019

I am trying to make rastervision work for a tiled map, so I run it on each tile I have, for example:
image

When I do, I get the error:

rastervision_1 | Executing rastervision predict /app/packages/xView_Vehicle.zip /images/674915186.png output/xView_Vehicle_674915186.png.json
rastervision_1 | (node:7) UnhandledPromiseRejectionWarning: Error: Command failed: rastervision predict /app/packages/xView_Vehicle.zip /images/674915186.png output/xView_Vehicle_674915186.png.json
rastervision_1 | 2019-03-26 14:44:13.975033: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
rastervision_1 | /usr/local/lib/python3.5/dist-packages/pluginbase.py:439: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
rastervision_1 | fromlist, level)
rastervision_1 | /usr/local/lib/python3.5/dist-packages/rasterio/init.py:217: NotGeoreferencedWarning: Dataset has no geotransform set. The identity matrix may be returned.
rastervision_1 | s = DatasetReader(path, driver=driver, **kwargs)
rastervision_1 | 2019-03-26 14:44:13:rastervision.task.task: INFO - Making predictions for scene
rastervision_1 | Traceback (most recent call last):
rastervision_1 | File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
rastervision_1 | "main", mod_spec)
rastervision_1 | File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
rastervision_1 | exec(code, run_globals)
rastervision_1 | File "/opt/src/rastervision/main.py", line 17, in
rastervision_1 | rv.main()
rastervision_1 | File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 722, in call
rastervision_1 | return self.main(*args, **kwargs)
rastervision_1 | File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 697, in main
rastervision_1 | rv = self.invoke(ctx)
rastervision_1 | File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 1066, in invoke
rastervision_1 | return _process_result(sub_ctx.command.invoke(sub_ctx))
rastervision_1 | File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 895, in invoke
rastervision_1 | return ctx.invoke(self.callback, **ctx.params)
rastervision_1 | File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 535, in invoke
rastervision_1 | return callback(*args, **kwargs)
rastervision_1 | File "/opt/src/rastervision/cli/main.py", line 240, in predict
rastervision_1 | predictor.predict(image_uri, output_uri, export_config)
rastervision_1 | File "/opt/src/rastervision/predictor.py", line 142, in predict
rastervision_1 | labels = self.task.predict_scene(scene, self.tmp_dir)
rastervision_1 | File "/opt/src/rastervision/task/task.py", line 192, in predict_scene
rastervision_1 | predict_batch(batch_chips, batch_windows)
rastervision_1 | File "/opt/src/rastervision/task/task.py", line 173, in predict_batch
rastervision_1 | np.array(predict_chips), predict_windows, tmp_dir)
rastervision_1 | File "/opt/src/rastervision/backend/tf_object_detection.py", line 736, in predict
rastervision_1 | self.session)
rastervision_1 | File "/opt/src/rastervision/backend/tf_object_detection.py", line 573, in compute_prediction
rastervision_1 | [boxes, scores, class_ids], feed_dict={image_tensor: image_nps})
rastervision_1 | File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 877, in run
rastervision_1 | run_metadata_ptr)
rastervision_1 | File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1076, in _run
rastervision_1 | str(subfeed_t.get_shape())))
rastervision_1 | ValueError: Cannot feed value of shape (2, 300, 300, 1) for Tensor 'image_tensor:0', which has shape '(?, ?, ?, 3)'
rastervision_1 |
rastervision_1 | at ChildProcess.exithandler (child_process.js:294:12)
rastervision_1 | at ChildProcess.emit (events.js:189:13)
rastervision_1 | at maybeClose (internal/child_process.js:970:16)
rastervision_1 | at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
rastervision_1 | (node:7) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
rastervision_1 | (node:7) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I am successfull at running the same code on TIF files, and JPEG.

@AmitMY AmitMY changed the title Allow PNGs as well as JPEG and TIF Allow These kind of Images Mar 26, 2019
@AmitMY AmitMY changed the title Allow These kind of Images Allow Map Tiles to be evaluated Mar 26, 2019
@lewfish lewfish self-assigned this Mar 26, 2019
@lewfish
Copy link
Contributor

lewfish commented Mar 26, 2019

I was not able to replicate this on the master branch. Could you please tell me the command you ran, the prediction package, the input image, and the branch/version you were using?

@AmitMY
Copy link
Author

AmitMY commented Mar 27, 2019

I ran:

rastervision predict /app/packages/xView_Vehicle.zip /images/674915186.png output/xView_Vehicle_674915186.png.json

(so xVIew_Vehicle package)

With that PNG image I put in the body of the issue,
and on cpu-latest docker image.

@lewfish
Copy link
Contributor

lewfish commented Mar 27, 2019

That png has 4 channels (the 4th is alpha), and the original experiment it was trained on didn't set an explicit channel_order. It should have recognized that the 4th channel was alpha and inferred a channel_order of [0, 1, 2] but didn't because of a bug in how we were loading null channel_orders. This PR fixes the problem #733

@AmitMY
Copy link
Author

AmitMY commented Mar 27, 2019

Thanks! I'm very happy you are very fast at responding and fixing issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants