profile
viewpoint

rajansaini691/allolib 0

Library for interactive multimedia application development

rajansaini691/allolib_playground 0

Code playground for allolib

rajansaini691/BouncingBox 0

First JFrame animation - literally a bouncing box

rajansaini691/Breakout 0

A clone of the game Breakout

startednorvig/paip-lisp

started time in 9 days

issue openeduNetworking/uWebSockets

Spurious constructor/destructor call

Basically one of the examples, except I added print statements to the PerSocketData's constructor/destructor. For some reason, the destructor is getting called immediately after a connection opens.

/* We simply call the root header file "App.h", giving you uWS::App and uWS::SSLApp */
#include "App.h"

/* This is a simple WebSocket echo server example.
 * You may compile it with "WITH_OPENSSL=1 make" or with "make" */

int main() {
    /* ws->getUserData returns one of these */
    struct PerSocketData {
        /* Fill with user data */
	PerSocketData() {
		std::cout << "Constructor call, this = " << std::hex << this << std::endl;
	}

	~PerSocketData() {
		std::cout << "Destructor call, this = " << std::hex << this << std::endl;
	}
    };

    /* Keep in mind that uWS::SSLApp({options}) is the same as uWS::App() when compiled without SSL support.
     * You may swap to using uWS:App() if you don't need SSL */
    uWS::SSLApp({
        /* There are example certificates in uWebSockets.js repo */
	    .key_file_name = "../misc/key.pem",
	    .cert_file_name = "../misc/cert.pem",
	    .passphrase = "1234"
	}).ws<PerSocketData>("/*", {
        /* Settings */
        .compression = uWS::SHARED_COMPRESSOR,
        .maxPayloadLength = 16 * 1024,
        .idleTimeout = 10,
        .maxBackpressure = 1 * 1024 * 1024,
        /* Handlers */
        .open = [](auto *ws) {
            /* Open event here, you may access ws->getUserData() which points to a PerSocketData struct */
        },
        .message = [](auto *ws, std::string_view message, uWS::OpCode opCode) {
            ws->send(message, opCode, true);
        },
        .drain = [](auto *ws) {
            /* Check ws->getBufferedAmount() here */
        },
        .ping = [](auto *ws) {
            /* Not implemented yet */
        },
        .pong = [](auto *ws) {
            /* Not implemented yet */
        },
        .close = [](auto *ws, int code, std::string_view message) {
            /* You may access ws->getUserData() here */
        }
    }).listen(9001, [](auto *token) {
        if (token) {
            std::cout << "Listening on port " << 9001 << std::endl;
        }
    }).run();
}

Output:

Listening on port 9001
Constructor call, this = 0x7fffffaed3b0
Destructor call, this = 0x7fffffaed3b0                    // Executed immediately after opening a connection
Destructor call, this = 0x558fc8161e50                    // Executed on disconnect

I believe that for this particular example, the actual "useful" memory allocated for the struct was at 0x558fc8161e50. Not sure what's going on at 0x7fffffaed3b0.

The only reason I feel obligated to report this is because I am worried this could be exploited. However, I'm not as familiar with the internals, so I'll defer on this one.

created time in 19 days

issue commentgoogle-coral/edgetpu

What are restrictions on ResizeNearestNeighbor?

@ppershing Just curious if you were able to get ResizeNearestNeighbor to convert? Theoretically, if we could reverse-engineer the linked repo's setup, we should be able to get that performance boost. Maybe one of tensorflow's nightly builds around December 28, 2019 should do it? (I got that from the commit history)

ppershing

comment created time in a month

issue commentgoogle-coral/edgetpu

Resize Nearest Neighbor does not convert

Hi @Namburger , would it be alright if you could compile this model as well? tiny_yolo.zip

Also, I'm experimenting with different quantization strategies, so I may end up sending you a few (not more than 1 or 2 per day) in the near future. Is there anything I can do to make the process more streamlined for you? Or perhaps compile it myself, if the team's okay with that?

rajansaini691

comment created time in a month

pull request commentyshui/picom

Add foreground blurring

Jus added an option and logic for blurring inactive. It seems to work, though it slows down switches between panes and occasionally does not blur my browser (qutebrowser) when it unfocuses.

rajansaini691

comment created time in a month

push eventrajansaini691/picom

Rajan Saini

commit sha 940ad0b612982982180bbe3e66eca6940b170e4e

Fix formatting

view details

push time in a month

push eventrajansaini691/picom

jialeens

commit sha 4d990b3d35dd43fb3b3a562026bcbc7f6d2f3dab

update picom.sample.conf Signed-off-by: jialeens <jialeadmin@163.com>

view details

yshui

commit sha 4bc1ef87c9d552a8b2136b4eb260025c179e8409

Merge pull request #491 from jialeens/next update picom.sample.conf

view details

Rajan Saini

commit sha 3f43cc5ea430d8f42682a096159ea49cbc90b169

Merge branch 'next' of https://github.com/yshui/picom into next

view details

Rajan Saini

commit sha 6555761d0f64941f730d77ee016a9dfffaa73bd4

Compiles now :)

view details

push time in a month

push eventrajansaini691/picom

Rajan Saini

commit sha 43cbf14550939ae9d17558e12635d035aad26bc3

Add an inactive-blur option

view details

Rajan Saini

commit sha 6f07ce0ea1a3620780b643e2a83243455d12675e

Check for inactive_blur when drawing fg blur

view details

push time in a month

pull request commentyshui/picom

Add foreground blurring

@tryone144 and @yshui thanks for the feedback! That sounds good, I'll add an option called inactive-blur.

The reason I was reluctant to put the logic in paint_all_new is because I thought it might be more maintainable to decouple foreground blurring from a specific option. This way, in the future, others could add other options that blur a window's foreground without touching paint_all_new. However, if you're okay with the strong coupling, that makes my end much easier.

rajansaini691

comment created time in a month

PR opened yshui/picom

Add foreground blurring

Discussion started from issue #489.

The end goal is to create a "focus mode" that blurs inactive windows; this is very much still a work in progress.

So far I have given windows a blur_foreground option and have successfully gotten it to work. Still need to:

  • Apply the blur when and only when the window is inactive and focus mode is enabled
  • Get a --focus-mode command line option

I am worried about strong coupling between modes and behaviors, which is preventing me from making progress. Ideally, the logic should be placed at a higher level rather than in paint_all_new. Does anyone more familiar with the codebase have any recommendations?

+22 -1

0 comment

2 changed files

pr created time in a month

push eventrajansaini691/picom

Rajan Saini

commit sha 2bc7b862c8da32cc0af897f1c1b692d354ed17a7

Add foreground blurring

view details

push time in a month

fork rajansaini691/picom

A lightweight compositor for X11

fork in a month

issue commentyshui/picom

Blur foreground?

@mighty9245 Thanks. I'll probably just directly implement it, then.

@yshui Awesome! Which branch should I use? Is it the next branch? Also, I'm trying to think of a good function name; how does blur_fg sound? Should the current blur be left as-is, or should it be refactored to blur_bg?

rajansaini691

comment created time in a month

issue openedyshui/picom

Blur foreground?

First of all, thanks for maintaining this repo, it's awesome!

Is it possible to blur the foreground of inactive windows? Kind of like typora's focus mode? If not, I'd be happy to add a PR, just let me know what would be least intrusive.

created time in a month

issue commentgoogle-coral/edgetpu

Internal Compiler Error with RetinaNet

Hello! I used the new tf2 object detection API and got a "less weird" tflite model (attached). However, it also throws an internal compiler error.

I'm guessing it has something to do with the postprocessing. A potential method of attack might be to cut it off by setting intermediate tensors, but I'm not sure what nodes to specify.

Here's the model

@Namburger Thank you so much for continuing to help by the way!!

rajansaini691

comment created time in 2 months

push eventrajansaini691/retinanet-model-tflite

Rajan Saini

commit sha 5b74d273b4d8976ceade64a76f6df5d69fb9a17c

Add out.tflite

view details

push time in 2 months

issue closedtensorflow/models

8-bit Quantization of RetinaNet

Prerequisites

1. The entire URL of the file you are using

https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf2_detection_zoo.md

2. Describe the bug

Applying 8-bit quantization to RetinaNet produces the following error:

RuntimeError: Quantization not yet supported for op: 'CUSTOM'.

I am using the new converter and have allow_custom_ops set to True, so this is unexpected.

3. Steps to reproduce

  1. Download the ssd resnet50 640x640 retinanet model from the model zoo
  2. Convert the model to a frozen graph using @srjoglekar246 's new script here
  3. Convert the frozen graph to a quantized tflite file with the new MLIR converter, with the following parameters:
converter.allow_custom_ops = True
converter.representative_dataset = representative_dataset_gen
converter.optimizations = [tf.lite.Optimize.DEFAULT]
converter.target_spec.supported_ops = [tf.lite.OpsSet.TFLITE_BUILTINS_INT8]    # Problematic

4. Expected behavior

The script should successfully produce a quantized model by emitting a "custom" op for each custom operation.

It would also be helpful if a member of the team could elucidate what these custom operations are, so that they can be passed to the tflite runtime.

5. Additional context

The TFLiteConverter successfully emits when quantization is disabled and when the experimental 8/16 quantization happens. It's the 8-bit-only-quantization that causes the crash.

Include any logs that would be helpful to diagnose the problem.

  File "quantize.py", line 39, in <module>
    tflite_quant_model = converter.convert()
  File "/home/rsaini/.pyenv/versions/tf2/lib/python3.7/site-packages/tensorflow/lite/python/lite.py", line 726, in convert
    output_tensors)
  File "/home/rsaini/.pyenv/versions/tf2/lib/python3.7/site-packages/tensorflow/lite/python/lite.py", line 648, in convert
    result = self._calibrate_quantize_model(result, **flags)
  File "/home/rsaini/.pyenv/versions/tf2/lib/python3.7/site-packages/tensorflow/lite/python/lite.py", line 476, in _calibrate_quantize_model
    inference_output_type, allow_float, activations_type)
  File "/home/rsaini/.pyenv/versions/tf2/lib/python3.7/site-packages/tensorflow/lite/python/optimize/calibrator.py", line 98, in calibrate_and_quantize
    np.dtype(activations_type.as_numpy_dtype()).num)
RuntimeError: Quantization not yet supported for op: 'CUSTOM'.

6. System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 20.04
  • Mobile device name if the issue happens on a mobile device: N/A (targeting Google Coral)
  • TensorFlow installed from (source or binary): Binary (pip)
  • TensorFlow version (use command below): 2.4.0-dev20200908
  • Python version: 3.7.7
  • Bazel version (if compiling from source): N/A
  • GCC/Compiler version (if compiling from source): N/A
  • CUDA/cuDNN version: 11
  • GPU model and memory:

closed time in 2 months

rajansaini691

issue openedtensorflow/models

8-bit Quantization of RetinaNet

Prerequisites

1. The entire URL of the file you are using

https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf2_detection_zoo.md

2. Describe the bug

Applying 8-bit quantization to RetinaNet produces the following error:

RuntimeError: Quantization not yet supported for op: 'CUSTOM'.

I am using the new converter and have allow_custom_ops set to True, so this is unexpected.

3. Steps to reproduce

  1. Download the ssd resnet50 640x640 retinanet model from the model zoo
  2. Convert the model to a frozen graph using @srjoglekar246 's new script here
  3. Convert the frozen graph to a quantized tflite file with the new MLIR converter, with the following parameters:
converter.allow_custom_ops = True
converter.representative_dataset = representative_dataset_gen
converter.optimizations = [tf.lite.Optimize.DEFAULT]
converter.target_spec.supported_ops = [tf.lite.OpsSet.TFLITE_BUILTINS_INT8]    # Problematic

4. Expected behavior

The script should successfully produce a quantized model by emitting a "custom" op for each custom operation.

It would also be helpful if a member of the team could elucidate what these custom operations are, so that they can be passed to the tflite runtime.

5. Additional context

The TFLiteConverter successfully emits when quantization is disabled and when the experimental 8/16 quantization happens. It's the 8-bit-only-quantization that causes the crash.

Include any logs that would be helpful to diagnose the problem.

  File "quantize.py", line 39, in <module>
    tflite_quant_model = converter.convert()
  File "/home/rsaini/.pyenv/versions/tf2/lib/python3.7/site-packages/tensorflow/lite/python/lite.py", line 726, in convert
    output_tensors)
  File "/home/rsaini/.pyenv/versions/tf2/lib/python3.7/site-packages/tensorflow/lite/python/lite.py", line 648, in convert
    result = self._calibrate_quantize_model(result, **flags)
  File "/home/rsaini/.pyenv/versions/tf2/lib/python3.7/site-packages/tensorflow/lite/python/lite.py", line 476, in _calibrate_quantize_model
    inference_output_type, allow_float, activations_type)
  File "/home/rsaini/.pyenv/versions/tf2/lib/python3.7/site-packages/tensorflow/lite/python/optimize/calibrator.py", line 98, in calibrate_and_quantize
    np.dtype(activations_type.as_numpy_dtype()).num)
RuntimeError: Quantization not yet supported for op: 'CUSTOM'.

6. System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 20.04
  • Mobile device name if the issue happens on a mobile device: N/A (targeting Google Coral)
  • TensorFlow installed from (source or binary): Binary (pip)
  • TensorFlow version (use command below): 2.4.0-dev20200908
  • Python version: 3.7.7
  • Bazel version (if compiling from source): N/A
  • GCC/Compiler version (if compiling from source): N/A
  • CUDA/cuDNN version: 11
  • GPU model and memory:

created time in 2 months

startedjarun/nnn

started time in 2 months

issue commentgoogle-coral/edgetpu

Resize Nearest Neighbor does not convert

Hi @Namburger thanks for your help. Would it be alright if you could convert this model with the new compiler? Also, if it isn't too much trouble, would it be alright if you could post its inference time? I want to make sure that my environment maximizes the detection speed.

tiny_yolo_test.zip

rajansaini691

comment created time in 2 months

startednickuraltsev/finity

started time in 2 months

issue openedfuhsjr00/bug.n

[Feature Request] Greying out inactive windows?

Hello! This project is a lifesaver! I was wondering whether it would be possible to apply some sort of overlay over inactive windows, like you can in compton (a compositor for X11). Apologies if this is a more inane question; I am not used to Windows.

created time in 2 months

issue commentqqwweee/keras-yolo3

mAP Tensorboard metric

Any updates on this?

AlbertoSabater

comment created time in 2 months

fork rajansaini691/uWebSockets

Simple, secure & standards compliant web server for the most demanding of applications

fork in 2 months

issue closedqqwweee/keras-yolo3

Changing class size results in NaN

Hello! I'm using a dataset with 2 classes with tiny yolo. As long as I leave the configuration intact (i.e. 80 classes, 255 filters) everything trains fine, except evaluation crashes (because 2 classes). However, when I change the number of classes to 2 and filters to 21, the loss becomes NaN. Actually, loss is NaN even if the # classes is 79 and filters is 252. Only time training works is for 80 classes and 255 filters.

Note: The second-layer output is NaN in these cases, causing the loss to be NaN. If anyone knows how to print a hidden layer's output during training, that would be very helpful with debugging.

Has anyone run into this issue? Has anyone even been able to use a custom dataset?

Training images are 512x512 if that may make any difference.

closed time in 3 months

rajansaini691

issue openedqqwweee/keras-yolo3

Changing class size results in NaN

Hello! I'm using a dataset with 2 classes. As long as I leave the configuration intact (i.e. 80 classes, 255 filters) everything trains fine, except evaluation crashes (because 2 classes). However, when I change the number of classes to 2 and filters to 21, the loss becomes NaN. Actually, loss is NaN even if the # classes is 79 and filters is 252. Only time training works is for 80 classes and 255 filters.

Has anyone run into this issue? Has anyone even been able to use a custom dataset?

Training images are 512x512 if that may make any difference.

created time in 3 months

issue commentgoogle-coral/edgetpu

Internal Compiler Error with RetinaNet

@Naveen-Dodda Thank you. I was using tf 2.3's TFLiteConverter API to perform the conversion and quantization correctly. Unfortunately I could not get tflite_convert to work with tf 1.15 without crashing: Check failed: std::floor((limit - start) / delta) == buffer.data.size() (79 vs. 80)

The original model I am trying to convert is the r50-fpn over here. I used their conversion script at models/official/detection/export_saved_model.py to convert to the SavedModel. (In case you wanted to reproduce my results, the only parameter I overrided was apply_nms, which I set to false to get quantization to work with 2.3).

What do you make of all of this, and what steps should I take to continue?

rajansaini691

comment created time in 3 months

IssuesEvent

issue closedgoogle-coral/edgetpu

Resize Nearest Neighbor does not convert

Hello again! I am attempting to adapt tiny yolo v3 to the edge tpu. My model quantizes and compiles, but it has inference times of ~1.5s. According to the logs, the RESIZE_NEAREST_NEIGHBOR op is not mapped to the edge device, which may account for the slowdown. What should I do to make the mapping successful and improve performance?

I am also using the newest compiler version with tensorflow 2.3.

model compiled model logs

closed time in 3 months

rajansaini691

issue commentgoogle-coral/edgetpu

Resize Nearest Neighbor does not convert

@Namburger You'll find this very interesting. It turns out that the edgetpu compiler fully compiles the tflite model here, which goes on to run in 27 ms! I then followed their instructions to create a retrained model for our dataset. It was a very convoluted process, but I ended up with a tflite model that was nearly identical node-for-node. The only difference was that my ResizeNearestNeighbor op has half_pixel_centers set to true, while theirs is set to false. I'm not sure what this does, other than that theirs compiled while mine didn't, causing a butterfly effect and a massive performance gap.

I am not sure why this is the case. I am guessing they used an older version of the TOCO converter, but my attempts at reverse-engineering their dev environment were not very fruitful. Anyway, if either of us can figure out how to set half_pixel_centers to false, or if your team can support it being set to true, we'll be able to get tiny yolo v3 running insanely quickly and reliably.

Also, your modifications really helped. Unfortunately we are still in the process of retraining and validating our model, so I may need to send you another file in a week or so :)

rajansaini691

comment created time in 3 months

issue commentgoogle-coral/edgetpu

Resize Nearest Neighbor does not convert

@Namburger You'll find this very interesting. It turns out that the edgetpu compiler fully compiles the tflite model here, which goes on to run in 27 ms! I then followed their instructions to create a retrained model for our dataset. It was a very convoluted process, but I ended up with a tflite model that was nearly identical node-for-node. The only difference was that my ResizeNearestNeighbor op has half_pixel_centers set to true, while theirs is set to false. I'm not sure what this does, other than that theirs compiled while mine didn't, causing a butterfly effect and a massive performance gap.

I am not sure why this is the case. I am guessing they used an older version of the TOCO converter, but my attempts at reverse-engineering their dev environment were not very fruitful. Anyway, if either of us can figure out how to set half_pixel_centers to false, or if your team can support it being set to true, we'll be able to get tiny yolo v3 running insanely quickly and reliably.

Also, your modifications really helped. Unfortunately we are still in the process of retraining and validating our model, so I may need to send you another file in a week or so :)

rajansaini691

comment created time in 3 months

issue openedgoogle-coral/edgetpu

Resize Nearest Neighbor does not convert

Hello again! I am attempting to adapt tiny yolo v3 to the edge tpu. My model quantizes and compiles, but it has inference times of ~1.5s. According to the logs, the RESIZE_NEAREST_NEIGHBOR op is not mapped to the edge device, which may account for the slowdown. What should I do to make the mapping successful and improve performance?

I am also using the newest compiler version with tensorflow 2.3.

model compiled model logs

created time in 3 months

issue commentgoogle-coral/edgetpu

ERROR: Didn't find op for builtin opcode 'RESIZE_NEAREST_NEIGHBOR' version '3'

Hello again! My model quantizes and compiles, but it has inference times of ~1.5s. According to the logs, the RESIZE_NEAREST_NEIGHBOR op is not mapped to the edge device, which may account for the slowdown. I am also using the newest compiler version with tensorflow 2.3. What should I do to make the mapping successful and improve performance?

model compiled model logs

JakubGal

comment created time in 3 months

push eventrajansaini691/retinanet-model-tflite

rajansaini691

commit sha c9dfb5b35b77bf87560220c2b434d76f08155298

Add files via upload

view details

push time in 3 months

fork rajansaini691/keras-yolo3

A Keras implementation of YOLOv3 (Tensorflow backend)

fork in 3 months

startedguichristmann/edge-tpu-tiny-yolo

started time in 3 months

issue commentPINTO0309/PINTO_model_zoo

model's output tensor size is not 4

+1 Same issue. Any update?

robertoshiu

comment created time in 3 months

more