Add minimum and maximum validations

Still needed to test some edge cases like float precisions and integer validations. Too late today >.<

There are two different things to note at that point:
1- Blocked since I can't print to the file the character % for the multipleOf validation
2- Found a bug on my PR itself where multiple number validations can't be applied at once

Now there is just the issue with the % sign and spaces on its sides

@jmaeso I'm interested in merging this if you could maybe rebase it from master?

I was testing after applying the rebase and got some issues. When reviewing the errors actually realized that master tests are not passing for me (suffix -Json is being added in all the generated structs and looks like it's not the expected behaviour). Since my code is like 1 year old now I would feel more confident if master gets fixed first in order to continue the rebase.
In case I am the only one experiencing the issue, I'm running go version go1.15.8 darwin/amd64

Implementation updated. Actually looks like I didn't need the % operator...
TIL %  operator does not support floats: https://play.golang.org/p/H3yaNpKbJhu
ps: feel free to require a different implementation strategy

Oh, incidentally I happened to hack on primitive validation too last night without noticing this, my approach is in #21 (only maximum/exclusiveMaximum done for now, but should be mostly trivial to add the rest). No personal preferences as to which approach to adopt as long as one is merged :) Will leave a few comments here.

I am closing this PR as it's become stale, and we'll likely review the whole validation system in the future.


Replace --attrName with --attr

Proposed changes
This PR update an option name. It replaces --attrName with --attr.
Types of changes
What types of changes does your code introduce to the project: Put an x in the boxes that apply

[ ] Bugfix (non-breaking change which fixes an issue)
[X] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] Update only documentation, not any source code.

Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of
them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before
merging your code.

[X] I have read the CONTRIBUTING doc
[X] I have signed the CLA
[X] I have added tests that prove my fix is effective or that my feature works
[X] I have added necessary documentation (if appropriate)
[ ] Any dependent changes have been merged and published in downstream modules

Further comments
N/A

Coverage remained the same at 100.0% when pulling 55303f1cd7f2203da5c8b6372f57af8d603fbc2b on fisuda:update/attrName into 0b7d9060d510bd566c41ea5ddbc5f8293b047850 on lets-fiware:main.


ExchangeRate returns incorrect expirationTime

Description
The expirationTime of the exchangeRate in a receipt is incorrect.
For example, the expiration time returned from a receipt is
{   "low":<PHONE_NUMBER>,   "high": 0,   "unsigned": false }
which should resolve to Thu Feb 24 2022 15:00:00
is in fact 1970-01-20T01:08:34.800Z in the receipt
Steps to reproduce
Run a transaction, get a receipt, print the receipt.exchangeRate.expirationTime
Additional context
No response
Hedera network
other
Version
v2.9.1
Operating system
No response

Fixed: here: https://github.com/hashgraph/hedera-sdk-js/commit/257b21e6590ffceb784378dd59b7adc238c9ff3d


Can't modify the camera output

actually it's not an issue.
i'v spent much time on modifying camera output frames before streaming but i couldn't do that.
the only thing i achieved was changing frames and displaying on another view.
i want to know is there any way the change frames before streaming to server?

I want to give some filters on output data of camera.
How can I get the output data of camera

you can use eglCreatePbufferSurface  for your camera holder. and get the
camera preview data from the buffer. then use egl buffer to do filters and
render buffer to a surface view. you need master the use of egl surface.
that is only useful for preview data.
2016-12-25 0:57 GMT+08:00 yuanming812<EMAIL_ADDRESS>
I want to give some filters on output data of camera.
How can I get the output data of camera
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/fyhertz/libstreaming/issues/236#issuecomment-269091869,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AE6Eyo8oz5ifQqDOZh2FQuj3y4YkUTWUks5rLU73gaJpZM4J92Eq
.

--
bestwishes
Paul Guo
thanks with love!!


Add a findOr method to Eloquent

This PR adds a findOr() method to the Eloquent Builder and Relations. This matches the existing firstOr() methods.
A typical scenario where this method is useful is when a resource route (e.g. /posts/1) cannot find a model that is not part of the URL, and so a findOrFail() returning a 404 is not appropriate.
Example usage:
User::findOr(1, fn () => throw new RuntimeException);
User::findOr(1, fn () => abort(403);
User::findOr(1, fn () => 'return something');

The method also supports passing columns as the second argument:
User::findOr(1, ['columns'], fn () => '...');

It also works on HasMany, HasManyThrough, BelongsToMany, MorphMany, and MorphToMany relations:
$user->posts()->findOr(1, fn () => '...');

Neat idea. Has some overlap use-case wise with Route::missing() that was added in 8.x: https://github.com/laravel/framework/pull/36035

Nice!

Great feature!!!

This method adds some flexibility instead of findOrFail() we can now handle the fail output using whatever callback.
@jessarcher congratulations for the great work.


[CI] Remove apt install of Conan cpython deps

Description
Part of #1114. The additional system packages for Linux builds are no longer necessary since #1038 - we now use the system-provided Python rather than the cpython Conan package, which required all these extra system dependencies.

[ ] I have updated the release notes.
[ ] I have updated all relevant user documentation.

FFTSAMAYL


Perf test

Tiny PR that adds a local test for performance + changed default lr_schedule to constant for A2C
Known issue: hyperparams needs to be tuned for mountaincarcontinuous

[ ] Tune hyperparams for continuous mountaincar

A more complete solution lies now in https://github.com/araffin/rl-baselines-zoo


Testing best_model on openEDS

Hi there,
Thank you so much for making the code available. I tried to test best_model on OpenEDS data, but the results don't look satisfying. I wanted to ask, what dataset was best_model trained on? Also, how well does best_model generalize to real-world data? I plan to use your model for eye segmentation of real-world images, and I was wondering if you can give me an insight on how well it performs, or what to look out for.
Below I have attached some of the results I got when I tested on OpenEDS. Is there any way to improve the resulting segmentations?

The images are not from OpenEDS-2019. The best model is trained on real images of OpenEDS-2019. Retraining the model in this dataset will help improve the result.


fix: market buy and sell UI bugs

fixes #196
@TalDerei can you please clarify what you meant by your last point in the issue (misplaced elements leading to inconsistent visual alignment)?

fixes #196
@TalDerei can you please clarify what you meant by your last point in the issue (misplaced elements leading to inconsistent visual alignment)?

that was a generic choice of words, I should have been more specific when pointing out UI flaws. Notice the residual zero that cannot be cleared and overlapping elements.

@cronokirby mentioned a bug fix with the duplicate amounts fixed via tailwind in the limit order PR: https://github.com/penumbra-zone/dex-explorer/pull/181/files#diff-ddaa81217b5d8d1ea37b43fe8b6feafcb0c8949ebf9a10806676c3f49acb6075R75

In that case, I think we are safe to land this before Limit orders, which might take more time.


Consider requiring CMake >= 3.15 with MSVC

Until CMake 3.15 there was no reliable way to switch the MSVC runtime library:
https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html
We have a hack in place:
https://github.com/googleapis/google-cloud-cpp/blob/467e97b4a3e07eb1ae9e28f16c64c45721c37de8/cmake/SelectMSVCRuntime.cmake#L30-L39
I think we should remove it and require customers to use a newer CMake with MSVC. Installing a new version is easy, assuming their own code does not require an older version. In theory, newer CMake versions should work fine with older CMake scripts: the CMake policy mechanism is supposed to help.

A newer cmake SGTM


Bugs of reloading model

🐛 Bug
Bugs of reloading model when best_k_models.json not exist
To Reproduce
https://github.com/mpariente/asteroid/blob/0bdec2644f2d770d037ce804b7f70cb98bd5c9fa/egs/wsj0-mix/DeepClustering/model.py#L156-L157
The lines use sort to get the last model, which will performs in a incorrect way  in the following situation
>>> all_ckpt=['ckpt_epoch_99.ckpt','ckpt_epoch_100.ckpt','ckpt_epoch_101.ckpt']
>>> all_ckpt.sort()
>>> all_ckpt[-1]
'ckpt_epoch_99.ckpt'

Expected behavior
Maybe we can use the following methods:
>>> all_ckpt=[(ckpt,int("".join(filter(str.isdigit,os.path.basename(ckpt))))) for ckpt in all_ckpt if ckpt.find('ckpt')>=0]
>>> all_ckpt.sort(key=lambda x:x[1])
>>> all_ckpt[-1][0]
'ckpt_epoch_101.ckpt'

Environment

Python 3.7

You're completely right, mind submitting a PR please?

Solved by #166


Do I need to apply convert_llama_weights_to_hf.py to the original 7B LLaMA weight?

When I directly run this command:
python apply_delta.py \
    --base /path/to/llama-13b \
    --target /output/path/to/vicuna-13b --delta /path/to/vicuna-13b-delta

It raises an OSError: ....../Video-LLaMA/model_weights/LLaMA_weight_7B does not appear to have a file named config.json.

Maybe the answer is YES.


Migrating docs to a separate repo

Splitting Bazzite docs into its own separate repo.
https://github.com/KyleGospo/docs.bazzite.gg
Adventages:

More relaxed requirements for pull requests approvals.
More relaxed file tree for documentation, rather than mixed with bazzite build files.
We can use a custom domain docs.bazzite.gg[^1]

Some thing that need to be done beforehand:

[ ] Adapt offline docs build step to pull from the new repo.
[x] Possible tweaks to mkdocs on the new repo side to use the new domain.
https://github.com/KyleGospo/docs.bazzite.gg/commit/5a0ac878c2780c4b2b9cf348ddf73da10d58252a
[ ] Remove deploy docs action from bazzite repo.

[^1]: This is something that is normally easy to do with Github pages, but would require passing the bazzite.gg domain to universal blue org, causing a downtime from 2 hours or more.

@nicknamenamenick


YJDH-329 | Add YouthApplication & endpoint /v1/youthapplications/

Description :sparkles:
Add an endpoint for saving a new YouthApplication:

POST /v1/youthapplications/

Required fields:

"first_name"
"last_name"
"social_security_number"

Must be a valid Finnish social security number or returns 400

"postcode"
"school"
"is_unlisted_school"
"email"
"phone_number"
"language"

Must be "fi", "sv" or "en" or returns 400

Also add a preliminary YouthSummerVoucher which links to a
YouthApplication.
Add tests for the YouthApplication:

test_youth_applications_list

For now should return 403 Forbidden

test_youth_application_post_valid_data

Should return 201 Created

test_youth_application_post_invalid_language

Should return 400 Bad request

test_youth_application_post_invalid_social_security_number

Should return 400 Bad request

Refs YJDH-329
Issues :bug:
YJDH-329
Testing :alembic:
Screenshots :camera_flash:
Additional notes :spiral_notepad:

Codecov Report

Merging #511 (0a73f28) into develop (5017aee) will increase coverage by 0.73%.
The diff coverage is 98.40%.

@@             Coverage Diff             @@
##           develop     #511      +/-   ##
===========================================
+ Coverage    94.39%   95.13%   +0.73%
===========================================
  Files          161       86      -75
  Lines         6406     2939    -3467
===========================================
- Hits          6047     2796    -3251
+ Misses         359      143     -216

Impacted Files
Coverage Δ

backend/kesaseteli/applications/models.py
97.75% <93.54%> (ø)

...kend/kesaseteli/applications/api/v1/serializers.py
96.93% <100.00%> (ø)

backend/kesaseteli/applications/api/v1/views.py
91.75% <100.00%> (ø)

...ns/0012_add_youthapplication_youthsummervoucher.py
100.00% <100.00%> (ø)

.../applications/tests/test_youth_applications_api.py
100.00% <100.00%> (ø)

backend/kesaseteli/common/tests/conftest.py
100.00% <100.00%> (ø)

backend/kesaseteli/common/tests/factories.py
100.00% <100.00%> (ø)

backend/kesaseteli/common/utils.py
100.00% <100.00%> (ø)

backend/kesaseteli/kesaseteli/settings.py
94.23% <100.00%> (ø)

backend/kesaseteli/kesaseteli/urls.py
90.47% <100.00%> (ø)

... and 180 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5017aee...0a73f28. Read the comment docs.


Running the benchmark tests - a few questions

I have investigated running the benchmark tests against the SQL CE provider.
Initially I just wanted to run the SQL Server tests on my own localdb instance.
I have noted the following:

You must set runIterations": true in the config.json file in the test project to actually enable running the benchmark tests (which makes sense)
You must manually create the "Benchmarks" database according to the setting in the "resultDatabases" key in config.json (and you can report results to multiple databases) - it looks like failure to save summary to the database disappears in cyberspace (when running via TestDriven)
You must restore an Adventureworks2014 to the instance in the "benchmarkDatabase" value in config.json

Q1: Do you have any tools/templates for consuming/presenting the data in the Runs table? (Excel, RDL file or similar) ?
Q2: What is the preferred way of executing the "tests" ? (I use TestDriven)

Notes about changes required to the Benchmarks.EF6 project in order to use the EntityFramework.SqlServerCompact provider
1: Created a Adventureworks2014.sdf file and added to the project
2: Added the EntityFramework.SqlServerCompact Nuget package

csproj changes:

  <ItemGroup>
    <None Remove="AdventureWorks2014.sdf" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="AdventureWorks2014.sdf">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="EntityFramework.SqlServerCompact" Version="6.1.3" />

3: Modified Fixture and DbContexts:
         public AdventureWorksContext(string connectionString)  : base(connectionString)
         {
              Database.SetInitializer<AdventureWorksContext>(null);
         }

     public class AdventureWorksFixture
     {
         public static AdventureWorksContext CreateContext()
             => new AdventureWorksContext(ConnectionString);
        public static string ConnectionString { get; } = $@"Data Source=AdventureWorks2014.sdf;";
     }

(OrdersFixture):
     _connectionString = $@"Data Source={databaseName}.sdf;";

4: Added DbConfiguration class:
    using System.Data.Entity;
    using System.Data.Entity.Infrastructure;
    using System.Data.Entity.SqlServerCompact;
    using System.Data.SqlServerCe;
    public class SqlCeConfiguration : DbConfiguration
    {
        public SqlCeConfiguration()
        {
            SetExecutionStrategy("System.Data.SqlServerCe.4.0", () => new DefaultExecutionStrategy());
            SetProviderFactory("System.Data.SqlServerCe.4.0", new SqlCeProviderFactory());
            SetProviderServices("System.Data.SqlServerCe.4.0", SqlCeProviderServices.Instance);
        }
    }

5: Modified Model and test to match SQL CE enigine limitations:
   // iso dbo.Products, no schemas in SQLCE
   .SqlQuery("SELECT * FROM Products")

  // only in and bigint can be IDENTITY with SQLCE
   public int DepartmentID { get; set; }

@ErikEJ
Q1: We have a Web-based dashboard that @rowanmiller put together. The code isn't public but I don't think there is a strong reason not to make it public (we should discuss this in triage).
Q2: You can use anything, but obviously anything running in the machine at the same time as the benchmarks will affect the quality of the results :smile: We run our benchmarks in a CI agent on dedicated hardware.
Good to know you were able to make the benchmarks work with SQL CE. Regarding the changes that required, if you happen to have any insights around things we could refactor to make it easier for the benchmarks to work with additional providers, feel free to send a PR.

@divega to create anew issue about making the dashboard source publicly available.

Closing since I believe we have answered the questions. @ErikEJ please let us know otherwise and feel free to reactivate. Also create #8285 to track making the Web UI public.


Load parts in first controller when app start running

When I tried to load some parts in config and other in controller I faced issue that parts from controller not loaded if this controller invoke when app starts.
Demo:
http://plnkr.co/edit/4GcpIlhPEvxMtyJxRbt1?p=preview
If you uncomment this line
$translateProvider.use('en');

code is start working, but as you can see in screenshot below part from config loaded two times.

As this is not the first time someone reports issues here in this "initialization way", I've looked a bit closer:
Hm, I guess the issue lies somewhere in here if the application is not initialized with the $uses variable but only with the $preferredLanguage - in this cases refresh skips the reloading of the parts as $uses is undefined:
https://github.com/angular-translate/angular-translate/blob/master/src/service/translate.js#L1873
@knalli what do you think?

$translateProvider.use() is actually not required when using $translateProvider.preferredLanguage() already.
Anyway: There is a $translate.refresh() which enforces a reload of all translations. If you call $translateProvider.use() explicitly, there will a load of the specified language. Afterwards (in the controller) all languages including the already loaded one will be reloaded. That is actually right because that's the intent of $translate.refresh().
Perhaps we could add an improvement ("Contributions Welcome") adding something like $translatePartialLoader.syncronize().
=> This is not a bug, but the result of the given configuration and flow.


kernel/svsm: Increase boot time stack by 4KB

During early boot of svsm kernel, init page table is created via still using the boot time stack. The page table is allocated by using PageBox which will get a temporary PTPage (4KB) from the stack via the PTPage::default() method. This increases the load on the boot time stack and may cause stack overflow in the next. As the default method requires 4KB stack size, increase the boot time stack by 4KB to satisfy this.
With code increasing in the future, the boot time stack may not be large enough again, so this is not a permanent fix but just works for short term. If it conflicts with any ongoing stack unwind/overflow works, please let me know and I will close it. Thanks!

Just to be sure, did you already face a crash due to stack overflow?

Just to be sure, did you already face a crash due to stack overflow?

I didn't face a crash with the upstream main, but did face a crash with my local development branch with additional changes ( IOIO PR, and some other changes for TDX). The crash happens around the init_page_table() when svsm kernel is still using the boot time stack. Increasing the boot time stack with 4k solves this for me. From another point of view, PTPage::default() consumes 1-page stack memory, which seems too heavy for the boot time stack as it totally only has 4-pages, and seems increasing it with additional 1-page would be an insurance for using PTPage::default() with the boot time stack.

I didn't face a crash with the upstream main, but did face a crash with my local development branch with additional changes ( IOIO PR, and some other changes for TDX). The crash happens around the init_page_table() when svsm kernel is still using the boot time stack. Increasing the boot time stack with 4k solves this for me. From another point of view, PTPage::default() consumes 1-page stack memory, which seems too heavy for the boot time stack as it totally only has 4-pages, and seems increasing it with additional 1-page would be an insurance for using PTPage::default() with the boot time stack.

Thanks for pointing this, that's a good catch. I'm quite surprised that PageBox::try_new(PageTable::default()) consumes a whole page on the stack (PageTable::default() would allocate a PageTable on the stack even though it's placed in a Box?).

My understanding is that, as PageTable contains PTPage, PageTable::default() will call the default method of PTPage, which consumes 4KB stack by let entries = [PTEntry::default(); ENTRY_COUNT];. So PTPage itself is in stack, until it is written to the heap page allocated by PageBox::try_new().

Maybe @00xc can help on this?
Overall this looks like a legit temporary solution.

Yes, I agree. Also pointed this out that this PR is not a permanent fix. Please let me know if I should close this PR. Thanks!

I ran into similar issues when working on the IRQ state code for PR #441. I added a commit there to actually double the boot-stack size, otherwise the test-in-svsm target reliably failed.
We need to investigate why the code-base is getting so stack hungry and work on a plan to fix that, but until then we just double the boot-stack size.
Another feature that would make boot-stack overflow behavior more consistent would be guard pages around it. That is another thing we should look into implementing.


Update the security daemon?

https://docs.microsoft.com/en-us/azure/iot-edge/how-to-update-iot-edge
Where to run these commands? The bash asks unixuser..pwd and I do not know pwd.
apt-get update
apt-get install libiothsm iotedge

@V4A001 Can you share more details on where exactly it's asking for a pwd.

Can you point me to where the vision kit security demon is updated from a WIndows Machine? I get the security question on either the shell of the adb shell and on the terminal session for the virtual environment.

@V4A001 It's an ARM32 camera, please use the following doc:
https://docs.microsoft.com/en-us/azure/iot-edge/how-to-install-iot-edge-linux

@V4A001 Closing issue. Please re-open if still an issue.


Full Nextclade updates

Description of proposed changes

Switch from cp to ln for full run sequences to improve disk usage and run time
The remaining uses of cp only apply when providing the keep_temp flag for debugging purposes. I'm avoiding using links for these to avoid the issue of Snakemake re-runs working unexpectedly during debugging.
Update full Nextclade instructions to avoid appending full run sequences to the cached aligned.fasta. See https://github.com/nextstrain/ncov-ingest/pull/380#pullrequestreview-1254080828

Testing

[ ] Checks pass

Locally tested hardlinks work as output/input for Snakemake with https://gist.github.com/joverlee521/d7705a249e81d552f945e01082fda861

I'll upload the touchfiles to S3 to trigger a full Nextclade run so that we can fix #387

So all that was missing was the inclusion of aligned in the README part - it's in the workflow, right?

Yes, things should work as expected as long as we upload both touchfiles for nextclade.tsv and aligned.fasta.

In case someone comes back here, I made it so we only need to update the nextclade.tsv touchfile - no aligned.fasta touchfile needed. This solves some issues we had if only the aligned.fasta touchfile was added.


can't compile sketch

I installed all libraries according to the 'getting started' and they show up in my 1.8.3 arduino IDE. I'm using a wemos d1 mini which works when I load the 'blink'.
But when i try to compile the 'bare minimum sketch' I get the error: 'endl' was not declared in this scope. Other examples bring different errors, 'TemperatureSensor' brings: Error compiling for board WeMos D1 D2 & mini, same error on 'LightOnOff' etc
Full error message:
_Arduino: 1.8.3 (Windows 7), Board: "WeMos D1 R2 & mini, 80 MHz, 921600, 4M (3M SPIFFS)"
d:\Users\bert\Documents\Arduino\libraries\homie-esp8266-1.5.0\src\Homie\MqttClient.cpp: In member function 'void HomieInternals::MqttClient::initMqtt(bool)':
d:\Users\bert\Documents\Arduino\libraries\homie-esp8266-1.5.0\src\Homie\MqttClient.cpp:32:143: error: no matching function for call to 'PubSubClient::setCallback(std::_Bind_helper<false, void (HomieInternals::MqttClient::)(char, unsigned char*, unsigned int), HomieInternals::MqttClient* const, const std::_Placeholder<1>&, const std::_Placeholder<2>&, const std::_Placeholder<3>&>::type)'
this->_pubSubClient.setCallback(std::bind(&MqttClient::_callback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
                                                                                ^

d:\Users\bert\Documents\Arduino\libraries\homie-esp8266-1.5.0\src\Homie\MqttClient.cpp:32:143: note: candidate is:
In file included from d:\Users\bert\Documents\Arduino\libraries\homie-esp8266-1.5.0\src\Homie\MqttClient.hpp:4:0,
             from d:\Users\bert\Documents\Arduino\libraries\homie-esp8266-1.5.0\src\Homie\MqttClient.cpp:1:

d:\Users\bert\Documents\Arduino\libraries\ESP8266_Microgear/PubSubClient.h:115:18: note: PubSubClient& PubSubClient::setCallback(void ()(char, uint8_t*, unsigned int))
PubSubClient& setCallback(MQTT_CALLBACK_SIGNATURE);

              ^

d:\Users\bert\Documents\Arduino\libraries\ESP8266_Microgear/PubSubClient.h:115:18: note:   no known conversion for argument 1 from 'std::_Bind_helper<false, void (HomieInternals::MqttClient::)(char, unsigned char*, unsigned int), HomieInternals::MqttClient* const, const std::_Placeholder<1>&, const std::_Placeholder<2>&, const std::_Placeholder<3>&>::type {aka std::_Bind<std::_Mem_fn<void (HomieInternals::MqttClient::)(char, unsigned char*, unsigned int)>(HomieInternals::MqttClient*, std::_Placeholder<1>, std::_Placeholder<2>, std::_Placeholder<3>)>}' to 'void ()(char, uint8_t*, unsigned int) {aka void ()(char, unsigned char*, unsigned int)}'
exit status 1
Error compiling for board WeMos D1 R2 & mini.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
_
No doubt I'm doing something wrong, but what? Thanks in advance for your feedback.

Both 'endl' and 'Homie_setFirmware' are not declared in the scope for me. I'm on MacOS 10.13.3 though, using PlatformIO Core 3.5.2.
Full error msg:
[Fri Mar  9 15:43:14 2018] Processing d1_mini (platform: espressif8266; lib_deps: Homie; board: d1_mini; framework: arduino)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
Collected 36 compatible libraries
Scanning dependencies...
Library Dependency Graph ( http://bit.ly/configure-pio-ldf )
|-- <Homie> v1.5.0
|   |-- <ArduinoJson> v5.13.1
|   |-- <PubSubClient> v2.6
|   |-- <Bounce2> v2.41
|   |-- <ESP8266mDNS>
|   |   |-- <ESP8266WiFi> v1.0
|   |-- <Ticker> v1.0
|   |-- <ESP8266WebServer> v1.0
|   |   |-- <ESP8266WiFi> v1.0
|   |-- <DNSServer> v1.1.0
|   |   |-- <ESP8266WiFi> v1.0
|   |-- <ESP8266httpUpdate> v1.1
|   |   |-- <ESP8266HTTPClient> v1.1
|   |   |   |-- <ESP8266WiFi> v1.0
|   |   |-- <ESP8266WiFi> v1.0
|   |-- <ESP8266WiFi> v1.0
Compiling .pioenvs/d1_mini/src/main.cpp.o
Compiling .pioenvs/d1_mini/FrameworkArduino/IPAddress.cpp.o
Compiling .pioenvs/d1_mini/FrameworkArduino/MD5Builder.cpp.o
Compiling .pioenvs/d1_mini/FrameworkArduino/Print.cpp.o
Compiling .pioenvs/d1_mini/FrameworkArduino/Schedule.cpp.o
Compiling .pioenvs/d1_mini/FrameworkArduino/Stream.cpp.o
Compiling .pioenvs/d1_mini/FrameworkArduino/StreamString.cpp.o
src/main.cpp: In function 'void setup()':
src/main.cpp:33:13: error: 'endl' was not declared in this scope
Serial << endl << endl;
^
src/main.cpp:35:44: error: 'Homie_setFirmware' was not declared in this scope
Homie_setFirmware("bare-minimum", "1.0.0");
^
*** [.pioenvs/d1_mini/src/main.cpp.o] Error 1

I solved it by using the homie-esp8266-2.0.0-beta.3 library. First I had 1.5.0 since that was marked as 'stable'.
now sketches compile without problem; compiling only mentions: "WARNING: Spurious .circleci folder in 'Homie' library" but that don't seem to be a problem
thanks for writing homie!

@marvinroger , @timpur you should release 2.0.0 on platformio to avoid issues like this.
Any bug fixes etc. before 2.1 can be released as 2.0.1 etc.

@euphi look at #454- maybe you can help me make relase notes


Can not enter custom name/image for custom radio URL

What version of Music Assistant has the issue?
2.1.0b8
What version of the Home Assistant Integration have you got installed?
2024.6.2
Have you tried everything in the Troubleshooting FAQ and reviewed the Open and Closed Issues and Discussions to resolve this yourself?

[X] Yes

The problem
I added a radio station via an URL and gave it a name.
Now I wanted to rename the station but there is no option for that.
So I removed the station from the library and tried re-adding it.
The dialog to rename the station shows up when adding but it then just goes back to the old name.
So that seems to be cached somewhere.
I tried restarting after removing and before re-adding.
How to reproduce
Add radio via URL
Give station a custom name
Remove Station
Add same URL
Enter new name
Ui shows old name
Music Providers
URL Radio
Player Providers

Full log output
No response
Additional information
No response
What version of Home Assistant Core are your running
2024.6.3
What type of installation are you running?
Home Assistant OS
On what type of hardware are you running?
Generic x86-64 (e.g. Intel NUC)

Keeping this one open

Just to add that I have added radios with custom names in the past (a couple of months ago maybe?), so this seems like a recently introduced bug.

Having the same issue
Home Assistant
Core 2024.7.3
Supervisor 2024.06.2
Operating System 12.4
Music Assistant
2.1.0
Adding radio stations no longer accepts custom name or image link
Beyond the bug there is no way to edit after added

confirm this:

Adding radio stations no longer accepts custom name or image link

same problem is here
Music Assistant
2.1.0

Please check if this has been fixed in 2.2.0rc1

I've just checked, and it works for me now. 👍


@damassi => Update metaphysics root query name to match recent update

Whoopsie, thank you for spotting!

👍

Oh dang, I failed at properly searching… Thanks for spotting and fixing, gents! 🙏


Add address sanitizer to SITL pipeline

Environment variables for building with asan
Docker argument for leak sanitizer
Regex for tests to fail on sanitizer error

Signed-off-by: Lukas Woodtli<EMAIL_ADDRESS>Please use PX4 Discuss or Slack to align on pull requests if necessary.
Test data / coverage
Logs uploaded to http://logs.px4.io or screenshots.
Describe problem solved by the proposed pull request
A clear and concise description of the problem, if any, this feature will solve. E.g. I'm always frustrated when ...
Describe your preferred solution
A clear and concise description of what you have implemented.
Describe possible alternatives
A clear and concise description of alternative solutions or features you've considered.
Additional context
Add any other context or screenshots for the feature request here.

@LukasWoodtli can this be added to sitl_gazebo repo Travis CI as well?

@LorenzMeier I'm glad I could help. Hopefully I’ll be able to contribute more soon!

@TSC21 I'll add it to sitl_gazebo as soon as I get some time.

@LukasWoodtli awesome! Thanks for contributing!


Add GYB support for Windows

GYB needs to be invoked via Python
Source files, using the Visual Studio generator, have to be in the source directory. This requires a bit of hackery, including modifying gitignore

Extracted from #5904

@swift-ci Please smoke test


Rename component to something that includes audio too

Since we are leveraging AVPlayer under the hood, playing audio just works fine too. Same rules apply. So It might be nice to rename the compoent to AudioVideo or something or just Media so people can easily understand that they can also play mp3s with this.

I'm all for supporting audio, but consider that audio does not require any display. So this raises the question of what it should look like if there's no video track.

Well it wouldn't display anything I guess. Right now you won't see anything. So you could just create a style which sizes the player to a height of 0. And then you'd just add you own custom controls to interface with it. How does that sound?

Or we could allow the user to pass in a static image, which gets displayed while playing the file. But I think not displaying anything should work for now

Yes, I think not displaying anything for now is the way to go. And I think
let's also assume custom controls as well. Player controls that make
everybody happy are hard/impossible to get right, and people almost always
want to customize them.
On Thu, Apr 9, 2015 at 11:28 AM, Johannes Lumpe<EMAIL_ADDRESS>wrote:

Or we could allow the user to pass in a static image, which gets displayed
while playing the file. But I think not displaying anything should work for
now
—
Reply to this email directly or view it on GitHub
https://github.com/brentvatne/react-native-video/issues/13#issuecomment-91264840
.

So does it make sense to have the audio be combined with video?
I think for someone looking to use this module, a simple default controls setup would go a long way. Then, could give the ability to customize their own layout.
I'm thinking of a use case where I have ~20 url of mp3 files I would want to pass to this component. Then, i could play/pause the current track and go back and forth throughout the array of url's to listen.
What do you guys think?

@mjw56 - agreed that this would be very useful, what would the ideal API for that look like to you? eg: <Audio tracks={this.state.tracksArray} />?

@brentvatne hey, yeah I was thinking of passing in an array. I guess it could accept a single string too and just convert that to an array.
What do you think?

We could maybe call it playlist?

Also @mjw56 I don't see any issue why we shouldn't merge audio and video into a single component
because the underlying AVPlayer can take care of both and the default controls should also be applyable to both media types.

Ok, would it potentially look something like this?
var Media = require('react-native-media');
var { Audio, Video } = Media;

@mjw56 - I like that

@mjw56 - definitely something to consider going forward, we are going to focus on getting the Video component working great and then look at this again. Something like <Media> element or <Audio> <Video> could work, we'll just have to see.

Closing this, discussions will continue in #14 :smile: :+1: :100:

Ok, btw right now I am doing it where I handle the successive playbacks from the component level. I have the playlist track data in a flux store which I can then query from when a song ends, skip track, etc. This approach is working really nicely. It would be nice though to have playlist support in the future. Overall this component works great for handling .mp3 url's. :) I need to test it out some more using some other audio file types.

@mjw56 I attempted to upload a .mp3 into my project with no luck, I can only use mp4s. How did you manage to get mp3s to work?

@csakon I'm currently only using mp3's loaded from URL's. I haven't tried with mp3 files from disk yet. I don't see why that shouldn't work though?

@mjw56 mp3 files from disk don't work, a red react native error pops up saying something about expecing an mp4 at the src. However, I found an iOS app that will let you export audio into mp4 and that works like a charm. I also learned that the names for the uri are case sensitive.

@mjw56 can you share a gist with an example to load mp3(s) from an external url?

@mjw56 @csakon I've had the same problem with loading mp3's from disk. Doesn't work. Bit of a shame, as mp4 increases the file size.
Curious why this would work with a url but not locally... Any ideas?


Invalid message: Error parsing message: Could not serialize frame: unknown consistency: 9

I seem to be receiving the following error sporadically:
Invalid message: Error parsing message: Could not serialize frame: unknown consistency: 9

My session configuration is pretty straightforward:
let mut session_builder = scylla::SessionBuilder::new();
session_builder = session_builder.use_keyspace(&config.keyspace, false);
// ...call `session_builder.known_node`...
// ...call `session_builder.user`
let session = session_builder.build().await?;

Running a 3 node cluster with all keyspaces configured with replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 3}.
Unable to reproduce this issue consistently other than when running a high number of queries in parallel.
Version:
[dependencies.scylla]
git = "https://github.com/cvybhu/scylla-rust-driver.git"
rev = "19c5df8205614c32f7c87279b3ce9c9a7e83d70e"  # See https://git.io/Jy6EW
features = ["ssl"]

I think this got broken by bff127f0511fac59f214f51b63ef3808a8d89c02 which split consistency and serial consistency into separate enums. @psarna I guess read_consistency() needs to know about serial consistency too?

Indeed - a whole class of errors keeps consistency information (e.g. https://github.com/scylladb/scylla-rust-driver/blob/51e088291b174cb2af6e6ed07cbbd48dfa6c5907/scylla/src/transport/errors.rs#L93-L100 )
and we need to make these errors work with SerialConsistency too, since it got broken by bff127f. I suppose a proper solution would be to have these errors store an enum which allows either Consistency or SerialConsistency values, not just Consistency.


Fix eval finetuned

Fixes the finetuning example by adding back the lines that import the sim environment.

Hey can you check back on this? It seems that the merging has not been successful.


Add RPi throttling info to web interface

As phonieboxes are mostly powered by power banks undervoltage issues might become an issue. This PR features showing the current and historic throttling state of the RPi on the web interface.
By running vcgencmd get_throttled you will get an error code that needs to be binary-decoded for further analyzation. Offical documentation: https://www.raspberrypi.org/documentation/raspbian/applications/vcgencmd.md
Why is this useful?
I'm using an onOffShim by Pimoroni and somehow it made my phoniebox instable in the last weeks. Random reboots that took some time to find the cause. Finally found out that undervoltage warnings are present on my RPi so I tried powering the RPi directly and not through the onOffShim and the undervoltage warning disappeared. Might be some cabeling issue or something else I've yet to figure out but nevertheless: I think it's a good idea to show if the RPi is or was in throttled mode and why. Would've saved me some time researching.

Wow, pretty cool. I have the same issue with onoffshim, so I'll give it a try.


Compute offering is not listed for vm when using disk offering strictness parameter

ISSUE TYPE

Bug Report

COMPONENT NAME
API

CLOUDSTACK VERSION
<IP_ADDRESS>

CONFIGURATION
n/a
OS / ENVIRONMENT
n/a
SUMMARY
When scaling a VM created with a compute offer created with the disk offering strictness parameter, other offers are not listed (even though there are others in the same zone with the same access options and also with the disk offering strictness parameter):

According to the option description, it should not be allowed to change the disk offering for the ROOT disk after the VM is deployed:

I don't know if there could be a connection, but the current behavior is to not allow changing the disk provision even during VM deployment:

I believe this was not the expected behavior.
STEPS TO REPRODUCE

Create two compute offerings with the disk offering strictness parameter
Create a virtual machine with 1 first compute offer created
Change the offer to the second one created

EXPECTED RESULTS
That it is possible to change the disk offering only during the deployment of the VM even if an offering with the disk offering strictness option has been chosen. And that it lists and allows scaling the machine to other computing offerings that also have the disk offering strictness option.
ACTUAL RESULTS
Compute offers are not listed when trying to scale the instance.

Able to reproduce the issue
The disk strictness related service offerings are not listed when scaling of a virtual machine is performed

@kiranchavala @lsgalves is this a UI only issue?

@kiranchavala @lsgalves is this a UI only issue?

No.
It can be reproduced by api/cloudmonkey

Sorry, please ignore this issue. The problem was occurring because the "Compute only disk offering" option was also enabled, so in this case there is no other offering with the same disk offering and therefore nothing is listed.
However, when scaling the offering the problem was different. When scaling I receive the error: "Unable to Scale VM, since disk offering id associated with the old service offering is not same for new service offering":

I noticed that both offers point to the same diskofferingid, this error should not occur.

@lsgalves , you say ignore this issue but then continue to describe another problem. Will you create a new issue for this one? (or maybe edit the title and description of this one?)


Side by Side views wont animate at the same time.

I have a use-case where two side-by-side components need to animate simultaneously.
<View></Sidebar></Content></View>
Sidebar and Content is at a set width on first render, on button click Sidebar should animate out of view and Content should take up full screen.  It seems like there is no way to get both of these components to animate at the same time. When I add animation only the sidebar will animate.
Code example:
import { ScrollView as MotiScrollView, MotiView } from 'moti';

export default function App () {

    const SIDEBAR_WIDTH = 400;
    const { width: fullWidth } = useWindowDimensions();
    const widthBasedOnSidebarState = showSidebar ? fullWidth - SIDEBAR_WIDTH : fullWidth;

    const Sidebar = ({ showSidebar }) => (
        <MotiView
            animate={{ translateX: showSidebar ? 0 : -SIDEBAR_WIDTH }}
            transition={{
            type: 'timing',
            duration: 400,
            }}
            style={{ width: SIDEBAR_WIDTH }}>
            <Text>Sidebar<Text/>
        </MotiView>
    );

    const Content = ({ showSidebar }) => (
        <MotiScrollView
            animate={{ width: widthBasedOnSidebarState }}
            transition={{
                type: 'timing',
                duration: 400,
            }}
            style={{ flexGrow: 1, width: widthBasedOnSidebarState }}>
            <Text>Content<Text/>
        </MotiScrollView>
    );

    return (
        <SafeAreaView style={{flexDirection: 'row', flex: 1}}>
            <Sidebar/>
            <Content/>
        </SafeAreaView>
    )
}

You shouldn't put the width in the style prop, this is probably the issue

you shouldn't declare components inside of other components

@nandorojo those are their own components... I just put them here for a code example.  If i do not add a width to the Content, when Sidebar closes the empty space is not filled and the Content  is pushed to the right side... here is a video
Style for Container:
<SafeAreaView style={{flexDirection: 'row', flex: 1}}>
 <Sidebar><Content>
</SafeAreaView

Style for Sidebar:
<MotiView
    animate={{
      translateX: showSidebar ? 0 : -SIDEBAR_WIDTH,
    }}
    transition={{
      type: 'timing',
      duration: 600,
    }}
    style={{ flex: 1 width: SIDEBAR_WIDTH, backgroundColor: '#1639c5', alignItems: 'center' }}
  >
  ...
  </MotiView>

Style for Content:
<MotiScrollView
    animate={{ width: widthBasedOnSidebarState }}
      transition={{
        type: 'timing',
        duration: 600,
      }}
      style={{ backgroundColor: '#dd0d26', alignItems: 'center', flexGrow: 1 }}
    >
  ...
  </MotiScrollView>

https://user-images.githubusercontent.com/28736699/123849303-7e12f900-d8cd-11eb-9bf7-e9e4af93b709.mp4

I'm saying that, if you want width to animate, you should put it in the animate prop, not the style prop, like you did in your example.

It's also possible that flex grow would mess with the animation if you're trying to animate width.

@nandorojo if you look at my updated styles listed in the last comment i removed the width from the Content before sending you that screen share I updated the styles.

@nandorojo i also made  sure to have the components declared outside... its animating! but not to the same speed. You can see the container beneath when you switch between sidebar in and out.
https://user-images.githubusercontent.com/28736699/123851438-08f4f300-d8d0-11eb-8aa8-12718198eef5.mp4

Works for me
Video: https://www.loom.com/share/5561da097cd946a7878b2691eb0b2a44
Snack: https://snack.expo.io/@beatgig/moti-animated-sidebar

That's because you made the duration 400 on one and 600 on the other.

seems that the issue was my CSS. thank you!

Glad it works.
Are you using this on web btw? (Out of curiosity)

no just on a react native app.


Backend Auditing

Setup sample application in JHipster
Compare C4SG code base with JHipster's sample app, to verify if we missed anything in architecture/design/configuration

This issue was moved to Code4SocialGood/c4sg-services#1


Update development-walkthrough.md from Buster to Bullseye

@jbpaux do you mind signing and repushing your commit

Oops, sorry, I guess I went too fast when committing. Should be good now :)


chore: replace black, fake8 and isort with ruff and ruff-format

This PR

replace black, flake8 and isort with ruff and ruff-format
enabled the rules, which replace flake8 and the plugins you mentioned in the pre-commit config
additionally enabled some more, which I used in an other project, but feel free to enable more, if something peaks your interest 🙂
adjusted GHA to use the pre-commit action instead

Related Issues

Fixes #219
Notes

Follow-up Tasks

How to test

hey @federicobond and @beeme1mr created a new PR, which only does the ruff addition. Will do the code adjustments in a follow-up PR.

Hey @gruebel, sorry for the delay here. Most of the team was out for the holidays. Things should speed up now that people are coming back 😄

@beeme1mr no problem 😄  Fixed the issue with the missing GHA version tag. It looks like they don't offer a shortened variant for it. I usually use commit hashes to pin all GHA versions. Are you interested in it or you want to keep it as is?

@beeme1mr no problem 😄 Fixed the issue with the missing GHA version tag. It looks like they don't offer a shortened variant for it. I usually use commit hashes to pin all GHA versions. Are you interested in it or you want to keep it as is?

I have a slight preference for version tags because they're easier to understand at a glance but I would be fine with either approach.

I have a slight preference for version tags because they're easier to understand at a glance but I would be fine with either approach.

All good, then let's keep as it is 🙂

I'll give @federicobond more time since he's our resident Python expert 😄

Sorry for the delay! I think this is good to merge. It's hard to understand all the implications of moving to a new set of style rules, but this moves us in the right direction regarding tooling, and if it turns out we need to fine-tune the config we can adjust it later.


Update global_agent_helper_prompt.md

GPT-3.5 for free plan

Tks!
On Tue, Nov 14, 2023 at 11:26 AM Philippe Rolet @.***>
wrote:

@.**** approved this pull request.
👍
—
Reply to this email directly, view it on GitHub
https://github.com/dust-tt/dust/pull/2525#pullrequestreview-1729405079,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AIBKDNSJEVPRIFS3CPRMLQDYENBONAVCNFSM6AAAAAA7KRLT6CVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTOMRZGQYDKMBXHE
.
You are receiving this because you authored the thread.Message ID:
@.***>

--
Pauline


notifications: Web app changes favicon for user's own PMs sent from iOS app.

While testing the web iOS app, I've noticed that the web app changes the favicon for a PM I've sent to another user:

the web app browser tab shows the new PM icon,
there is no desktop notification.

The browser tab should not show a new PM icon for the message sender.
It probably has something to do with static/js/unread.js, specifically the unread_privates variable. We could check if the sender id is the message author's - any other ideas on how we could approach it?
original issue: https://github.com/zulip/zulip-mobile/issues/326

In theory, this should be handle on the backend; zerver/lib/actions.py sets the flags to read for any message sent by a user using a client which is tagged as being "a human user client".  I think the problem is we're missing zulipmobile from the list below in zerver/models.py:
    def sent_by_human(self):
        # type: () -> bool
        sending_client = self.sending_client.name.lower()

        return (sending_client in ('zulipandroid', 'zulipios', 'zulipdesktop',
                                   'website', 'ios', 'android')) or (
                                       'desktop app' in sending_client)

@akashnimare what user-agent is the Electron app using; is it ZulipElectron?  We need to add it here as well.

I guess electron is currently showing as "website" for this purpose, which is OK but not ideal.

Fixed via 99c0b0e79fb08e3e3938868d3876512f22b15d6b, thanks for the report @trueskawka!

Thanks for the explanation and a great commit message - it cleared things up for me :)


Rolling back to KaikoSdk 1.13.0

Also needed to add dependencies to Microsoft Configuration libraries 🤔

It looks like some endpoints have changed named, I think it is OK to say that we expected a `StatusCode.Unimplemented` response until we move to the later SDK

closing as @emanuelgaspar did the upgrade to 1.15 in #236


Whitelist  tags

When writing Markdown, it can be useful to be able to include icons using  tags, whether it's using FontAwesome or some other library.  So unless there's some security concern I don't know about, I would like to propose adding the  tag to the list of allowed tags.

As stated here

The idea of markdown-it-sanitizer is to allow html code for things that you could also describe using markdown.

I do however recognize that there are other applications for this library than my own and because of this issue I'm currently thinking about adding settings to change the accepted tags and attributes.

I think that would be great feature to add. Even just loading a list of allowed tags from the config object, or use the default if the object doesn't contain the appropriate property , would probably work fine, right?


Add monday.com as an OAuth provider

Hey!
I've added monday.com as an OAuth provider.
I've intentionally kept the .com as per their brand guidelines here when displaying the list of providers in the admin UI.
I've ran all tests, and lint checks.
All tests passed, and there were no additional linting issues
Info setting up a monday.com app can be found here:

https://developer.monday.com/apps/docs/create-an-app
https://developer.monday.com/apps/docs/oauth

I've seen here that OAuth provider PRs probably won't be merged until after the refactor, so take as long as you need.
Let me know if there are any changes you'd like made before or after the refactor.
I've also verified that this works using a similar file to the one mentioned here:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>monday.com OAuth2 test</title>

    <button id="btn">Login with monday.com</button>

Let me know if you have any other feedback, cheers!

Thank you, I'll review and test it in more details in the next couple weeks.
I'm not sure if it is needed but just to be safe, could you also add a check for the enabled user field, something like:
if !extracted.Data.Me.Enabled {
    return nil, errors.New("the Monday's user is not enabled")
}

I've tested the integration locally and it seems to work correctly.
The provider is squash-merged in the develop branch with some minor changes to accommodate the new internal APIs and it will be part of v0.23.0 release (there are no ETAs yet).


Party names on Candidate/search result pages

Excellent resource. Just one suggestion, when you pull up a constituency it would be good if you also showed the party on the screen rather than having to go into every candidate to see which party they are from.

Should it stay in pages like this: http://irish-elections.storyful.com/candidates
It could fit underneath the constituency

Yep would be good - would make more sense if it is structured like:
Candidate name
Party
Constituency
That possible?  @giannileggio

Yes, this is possible @donieosullivan

Fixed in https://github.com/storyful/irish-elections/pull/10


Improve the Finnish translation

@nuuttitoivola I restarted the failing build - tests shouldn't be affected by this change!

Thanks @nuuttitoivola!


Visualize edge usage in routes

Similar to your edge centrality tutorial
https://github.com/gboeing/osmnx-examples/blob/master/notebooks/08-example-line-graph.ipynb
I have a graph of finland

I want to color edges in the map of finland on the number of vehicles passing through an edge .
For example below are my route optimization results
FROM;TO;VEHICLES
Helsinki;Lahti;10
Helsinki;Jyväskylä;1
(The same road goes from Helsinki through Lahti to Jyvaskyla)
In the end i want my graph to look like this

############################################################
I was able to successfully draw multiple routes.
(The below code would draw multiple routes on graph drawn)
    routingResultsDf = get_dataframe_from_file(resultsFile, resultsFileType)
    maxAlphaDivisor= routingResultsDf['VEHICLES'].max()

    G = ox.load_graphml('../data/network.graphml')

    route_list = []
    route_list_rgba_tuple = []
    for index, row in routingResultsDf.iterrows():
        try:

            vehicles = int(float(row[vehColName]))

            if vehicles> 0:
                alpha_value=vehicles/maxAlphaDivisor + 0.20
                rgba_tuple = (1.0,0.0,0.0,alpha_value)

                route_list_rgba_tuple.append(rgba_tuple)

                origin_city_name=row[routingFromColName]
                origin_city = cityToLongLat[origin_city_name]
                origin_node = ox.get_nearest_node(G, origin_city)

                destination_city_name= row[routingToColName]
                destination_city = cityToLongLat[destination_city_name]
                desitination_node = ox.get_nearest_node(G, destination_city)
                # route is list of osm nodes
                route = nx.shortest_path(G,origin_node,desitination_node, weight='length')
                route_list.append(route)
        except KeyError:
            pass
        except nx.NetworkXNoPath:
            pass
    fig, ax = plot_graph_routes(G, route_list, route_list_rgba_tuple= route_list_rgba_tuple,
                                fig_height=15, fig_width=10,
                                node_size=0, edge_linewidth=0.2,edge_alpha=0.2,edge_color='b',
                                orig_dest_node_size=1,route_linewidth=1)

I was successful in manipulating Alpha value based on traversal of edge by extracting and changing the  ox.plot_graph_routes(..) function as below. changed lines are commented as #CHANGED
def plot_graph_routes(G, routes, bbox=None, fig_height=6, fig_width=None,
                      margin=0.02, bgcolor='w', axis_off=True, show=True,
                      save=False, close=True, file_format='png', filename='temp',
                      dpi=300, annotate=False, node_color='#999999',
                      node_size=15, node_alpha=1, node_edgecolor='none',
                      node_zorder=1, edge_color='#999999', edge_linewidth=1,
                      edge_alpha=1, use_geom=True, orig_dest_points=None,
                      route_color='r', route_linewidth=4,
                      route_alpha=0.5, orig_dest_node_alpha=0.5,
                      orig_dest_node_size=100, orig_dest_node_color='r',
                      orig_dest_point_color='b', route_list_rgba_tuple= []):#CHANGED last argument added

    # plot the graph but not the routes
    fig, ax = ox.plot_graph(G, bbox=bbox, fig_height=fig_height, fig_width=fig_width,
                         margin=margin, axis_off=axis_off, bgcolor=bgcolor,
                         show=False, save=False, close=False, filename=filename,
                         dpi=dpi, annotate=annotate, node_color=node_color,
                         node_size=node_size, node_alpha=node_alpha,
                         node_edgecolor=node_edgecolor, node_zorder=node_zorder,
                         edge_color=edge_color, edge_linewidth=edge_linewidth,
                         edge_alpha=edge_alpha, use_geom=use_geom)

    # save coordinates of the given reference points
    orig_dest_points_lats = []
    orig_dest_points_lons = []

    if orig_dest_points is None:
        # if caller didn't pass points, use the first and last node in each route as
        # origin/destination points
        for route in routes:
            origin_node = route[0]
            destination_node = route[-1]
            orig_dest_points_lats.append(G.nodes[origin_node]['y'])
            orig_dest_points_lats.append(G.nodes[destination_node]['y'])
            orig_dest_points_lons.append(G.nodes[origin_node]['x'])
            orig_dest_points_lons.append(G.nodes[destination_node]['x'])

    else:
        # otherwise, use the passed points as origin/destination points
        for point in orig_dest_points:
            orig_dest_points_lats.append(point[0])
            orig_dest_points_lons.append(point[1])
        orig_dest_node_color = orig_dest_point_color

    # scatter the origin and destination points
    ax.scatter(orig_dest_points_lons, orig_dest_points_lats, s=orig_dest_node_size,
               c=orig_dest_node_color, alpha=orig_dest_node_alpha, edgecolor=node_edgecolor, zorder=4)

    # plot the routes lines
    lines = []
    lines_rgba = []
    for id,route in enumerate(routes):
        edge_nodes = list(zip(route[:-1], route[1:]))
        for u, v in edge_nodes:
            # if there are parallel edges, select the shortest in length
            data = min(G.get_edge_data(u, v).values(), key=lambda x: x['length'])

            # if it has a geometry attribute (ie, a list of line segments)
            if 'geometry' in data and use_geom:
                # add them to the list of lines to plot
                xs, ys = data['geometry'].xy
                lines.append(list(zip(xs, ys)))
            else:
                # if it doesn't have a geometry attribute, the edge is a straight
                # line from node to node
                x1 = G.nodes[u]['x']
                y1 = G.nodes[u]['y']
                x2 = G.nodes[v]['x']
                y2 = G.nodes[v]['y']
                line = [(x1, y1), (x2, y2)]
                lines.append(line)

    #generate same tuple for each segment of line
    length_lines= len(lines)  #CHANGED new line
    rgba_color_lines= [route_list_rgba_tuple[id]]* length_lines #CHANGED new line
    # add the lines to the axis as a linecollection
    lc = LineCollection(lines, colors=rgba_color_lines, linewidths=route_linewidth, zorder=3)##CHANGED removed one alpha value for float
    ax.add_collection(lc)

    # save and show the figure as specified
    fig, ax = ox.save_and_show(fig, ax, save, show, close, filename, file_format, dpi, axis_off)
    return fig, ax

My results are below

MY QUESTION IS
How can a put a tile behind the graph at this point and how to put major city names on map. I have coordinates of the cities.
Muncipality | Population | Latitude | Longitude
Helsinki | 645439 | 60.17083333 | 24.9375
Jyväskylä | 140254 | 62.24027778 | 25.74444444
Lahti | 119726 | 60.98333333 | 25.65555556

It can be done in folium
#map_ = folium.Map(location = old_market, zoom_start = 16)	#tiles = 'Stamen Watercolor' or 'OpenStreetMap'
and folium marker can be used to name the cities. You can save html out put.

@isfando for how-to questions like this, best to ask the user community at StackOverflow per the contributing guidelines. To add labels to your plot, OSMnx produces matplotlib fig, ax when it plots and you can then just use matplotlib to add labels or other plotting elements as usual.


Shorten the cluster 'name' by using the class simple name

How much of this problem can we solve, directly, before we have to say "Windows doesn't really work - just check things out closer to a root - err 'letter'"?
We can avoid aggravating the problem but, at some point, we have to acknowledge that this is a bug in something else.

I will merge this as it reduces the aggravation of the issue but, if we want a more complete solution, we probably need to root the tests externally to the build target.


feat: port Analysis.InnerProductSpace.Calculus

[ ] depends on: #4529

This PR/issue depends on:

leanprover-community/mathlib4#4529
By Dependent Issues (🤖). Happy coding!

This PR/issue depends on:

leanprover-community/mathlib4#4529
By Dependent Issues (🤖). Happy coding!

bors merge


Added LoadPlaylist

There was no intuitive way of loading a collection of video paths as a single playlist before playing everything. I've created a LoadPlaylist methods which takes any IEnumerable of strings as video paths to play in order of enumeration.

My bad, this pull request also has the changes from #30. Will redo without them.

My bad, this pull request also has the changes from #30. Will redo without them.


How to train gray images by one channel?

I'm sorry for asking this stupid question, I have tried for so many days, but I can't figure it out. I can ask no one in my laboratory, I wish someone could help me, thank you!
model.py
from __future__ import print_function
import os
import time
import random
import datetime
import scipy.misc
import numpy as np
import tensorflow as tf
import tensorflow.contrib.slim as slim
from datetime import datetime
from util.util import *
from util.BasicConvLSTMCell import *
import sys
reload(sys)
sys.setdefaultencoding('utf8')

class DEBLUR(object):
    def __init__(self, args):
        self.args = args
        self.n_levels = 3
        self.scale = 0.5
        self.chns = 1

        # if args.phase == 'train':
        self.crop_size = 128
        self.data_list = open(args.datalist, 'rt').read().splitlines()
        self.data_list = list(map(lambda x: x.split(' '), self.data_list))
        random.shuffle(self.data_list)
        self.train_dir = os.path.join('./checkpoints', args.model)
        if not os.path.exists(self.train_dir):
            os.makedirs(self.train_dir)

        self.batch_size = args.batch_size
        self.epoch = args.epoch
        self.data_size = (len(self.data_list)) // self.batch_size
        self.max_steps = int(self.epoch * self.data_size)
        self.learning_rate = args.learning_rate

    def input_producer(self, batch_size=10):
        def read_data():
            img_a = tf.image.decode_image(tf.read_file(tf.string_join(['./training_set/', self.data_queue[0]])),
                                          channels=0)
            img_b = tf.image.decode_image(tf.read_file(tf.string_join(['./training_set/', self.data_queue[1]])),
                                          channels=0)
            img_a, img_b = preprocessing([img_a, img_b])
            return img_a, img_b

        def preprocessing(imgs):
            imgs = [tf.cast(img, tf.float32) / 255.0 for img in imgs]
            if self.args.model != 'color':
                imgs = [tf.image.rgb_to_grayscale(img) for img in imgs]
            img_crop = tf.unstack(tf.random_crop(tf.stack(imgs, axis=0), [2, self.crop_size, self.crop_size, self.chns]),
                                  axis=0)
            return img_crop

        with tf.variable_scope('input'):
            List_all = tf.convert_to_tensor(self.data_list, dtype=tf.string)
            gt_list = List_all[:, 0]
            in_list = List_all[:, 1]

            self.data_queue = tf.train.slice_input_producer([in_list, gt_list], capacity=20)
            image_in, image_gt = read_data()
            batch_in, batch_gt = tf.train.batch([image_in, image_gt], batch_size=batch_size, num_threads=8, capacity=20)

        return batch_in, batch_gt

    def generator(self, inputs, reuse=False, scope='g_net'):
        n, h, w, c = inputs.get_shape().as_list()

        if self.args.model == 'lstm':
            with tf.variable_scope('LSTM'):
                cell = BasicConvLSTMCell([h / 4, w / 4], [3, 3], 128)
                rnn_state = cell.zero_state(batch_size=self.batch_size, dtype=tf.float32)

        x_unwrap = []
        with tf.variable_scope(scope, reuse=reuse):
            with slim.arg_scope([slim.conv2d, slim.conv2d_transpose],
                                activation_fn=tf.nn.relu, padding='SAME', normalizer_fn=None,
                                weights_initializer=tf.contrib.layers.xavier_initializer(uniform=True),
                                biases_initializer=tf.constant_initializer(0.0)):

                inp_pred = inputs
                for i in xrange(self.n_levels):
                    scale = self.scale ** (self.n_levels - i - 1)
                    hi = int(round(h * scale))
                    wi = int(round(w * scale))
                    inp_blur = tf.image.resize_images(inputs, [hi, wi], method=0)
                    inp_pred = tf.stop_gradient(tf.image.resize_images(inp_pred, [hi, wi], method=0))
                    inp_all = tf.concat([inp_blur, inp_pred], axis=3, name='inp')
                    if self.args.model == 'lstm':
                        rnn_state = tf.image.resize_images(rnn_state, [hi // 4, wi // 4], method=0)

                    # encoder
                    conv1_1 = slim.conv2d(inp_all, 32, [5, 5], scope='enc1_1')
                    conv1_2 = ResnetBlock(conv1_1, 32, 5, scope='enc1_2')
                    conv1_3 = ResnetBlock(conv1_2, 32, 5, scope='enc1_3')
                    conv1_4 = ResnetBlock(conv1_3, 32, 5, scope='enc1_4')
                    conv2_1 = slim.conv2d(conv1_4, 64, [5, 5], stride=2, scope='enc2_1')
                    conv2_2 = ResnetBlock(conv2_1, 64, 5, scope='enc2_2')
                    conv2_3 = ResnetBlock(conv2_2, 64, 5, scope='enc2_3')
                    conv2_4 = ResnetBlock(conv2_3, 64, 5, scope='enc2_4')
                    conv3_1 = slim.conv2d(conv2_4, 128, [5, 5], stride=2, scope='enc3_1')
                    conv3_2 = ResnetBlock(conv3_1, 128, 5, scope='enc3_2')
                    conv3_3 = ResnetBlock(conv3_2, 128, 5, scope='enc3_3')
                    conv3_4 = ResnetBlock(conv3_3, 128, 5, scope='enc3_4')

                    if self.args.model == 'lstm':
                        deconv3_4, rnn_state = cell(conv3_4, rnn_state)
                    else:
                        deconv3_4 = conv3_4

                    # decoder
                    deconv3_3 = ResnetBlock(deconv3_4, 128, 5, scope='dec3_3')
                    deconv3_2 = ResnetBlock(deconv3_3, 128, 5, scope='dec3_2')
                    deconv3_1 = ResnetBlock(deconv3_2, 128, 5, scope='dec3_1')
                    deconv2_4 = slim.conv2d_transpose(deconv3_1, 64, [4, 4], stride=2, scope='dec2_4')
                    cat2 = deconv2_4 + conv2_4
                    deconv2_3 = ResnetBlock(cat2, 64, 5, scope='dec2_3')
                    deconv2_2 = ResnetBlock(deconv2_3, 64, 5, scope='dec2_2')
                    deconv2_1 = ResnetBlock(deconv2_2, 64, 5, scope='dec2_1')
                    deconv1_4 = slim.conv2d_transpose(deconv2_1, 32, [4, 4], stride=2, scope='dec1_4')
                    cat1 = deconv1_4 + conv1_4
                    deconv1_3 = ResnetBlock(cat1, 32, 5, scope='dec1_3')
                    deconv1_2 = ResnetBlock(deconv1_3, 32, 5, scope='dec1_2')
                    deconv1_1 = ResnetBlock(deconv1_2, 32, 5, scope='dec1_1')
                    inp_pred = slim.conv2d(deconv1_1, self.chns, [5, 5], activation_fn=None, scope='dec1_0')

                    if i >= 0:
                        x_unwrap.append(inp_pred)
                    if i == 0:
                        tf.get_variable_scope().reuse_variables()

            return x_unwrap

    def build_model(self):
        img_in, img_gt = self.input_producer(self.batch_size)

        tf.summary.image('img_in', im2uint8(img_in))
        tf.summary.image('img_gt', im2uint8(img_gt))
        print('img_in, img_gt', img_in.get_shape(), img_gt.get_shape())

        # generator
        x_unwrap = self.generator(img_in, reuse=False, scope='g_net')
        # calculate multi-scale loss
        self.loss_total = 0
        for i in xrange(self.n_levels):
            _, hi, wi, _ = x_unwrap[i].get_shape().as_list()
            gt_i = tf.image.resize_images(img_gt, [hi, wi], method=0)
            loss = tf.reduce_mean((gt_i - x_unwrap[i]) ** 2)
            self.loss_total += loss

            tf.summary.image('out_' + str(i), im2uint8(x_unwrap[i]))
            tf.summary.scalar('loss_' + str(i), loss)

        # losses
        tf.summary.scalar('loss_total', self.loss_total)

        # training vars
        all_vars = tf.trainable_variables()
        self.all_vars = all_vars
        self.g_vars = [var for var in all_vars if 'g_net' in var.name]
        self.lstm_vars = [var for var in all_vars if 'LSTM' in var.name]
        for var in all_vars:
            print(var.name)

    def train(self):
        def get_optimizer(loss, global_step=None, var_list=None, is_gradient_clip=False):
            train_op = tf.train.AdamOptimizer(self.lr)
            if is_gradient_clip:
                grads_and_vars = train_op.compute_gradients(loss, var_list=var_list)
                unchanged_gvs = [(grad, var) for grad, var in grads_and_vars if not 'LSTM' in var.name]
                rnn_grad = [grad for grad, var in grads_and_vars if 'LSTM' in var.name]
                rnn_var = [var for grad, var in grads_and_vars if 'LSTM' in var.name]
                capped_grad, _ = tf.clip_by_global_norm(rnn_grad, clip_norm=3)
                capped_gvs = list(zip(capped_grad, rnn_var))
                train_op = train_op.apply_gradients(grads_and_vars=capped_gvs + unchanged_gvs, global_step=global_step)
            else:
                train_op = train_op.minimize(loss, global_step, var_list)
            return train_op

        global_step = tf.Variable(initial_value=0, dtype=tf.int32, trainable=False)
        self.global_step = global_step

        # build model
        self.build_model() # TODO

        # learning rate decay
        self.lr = tf.train.polynomial_decay(self.learning_rate, global_step, self.max_steps, end_learning_rate=0.0,
                                            power=0.3)
        tf.summary.scalar('learning_rate', self.lr)

        # training operators
        train_gnet = get_optimizer(self.loss_total, global_step, self.all_vars)

        # session and thread
        gpu_options = tf.GPUOptions(allow_growth=True)
        sess = tf.Session(config=tf.ConfigProto(gpu_options=gpu_options))
        self.sess = sess
        sess.run(tf.global_variables_initializer())
        self.saver = tf.train.Saver(max_to_keep=50, keep_checkpoint_every_n_hours=1)
        coord = tf.train.Coordinator()
        threads = tf.train.start_queue_runners(sess=sess, coord=coord)

        # training summary
        summary_op = tf.summary.merge_all()
        summary_writer = tf.summary.FileWriter(self.train_dir, sess.graph, flush_secs=30)

        for step in xrange(sess.run(global_step), self.max_steps + 1):

            start_time = time.time()

            # update G network
            _, loss_total_val = sess.run([train_gnet, self.loss_total])

            duration = time.time() - start_time
            # print loss_value
            assert not np.isnan(loss_total_val), 'Model diverged with loss = NaN'

            if step % 5 == 0:
                num_examples_per_step = self.batch_size
                examples_per_sec = num_examples_per_step / duration
                sec_per_batch = float(duration)

                format_str = ('%s: step %d, loss = (%.5f; %.5f, %.5f)(%.1f data/s; %.3f s/bch)')
                print(format_str % (datetime.now().strftime('%Y-%m-%d %H:%M:%S'), step, loss_total_val, 0.0,
                                    0.0, examples_per_sec, sec_per_batch))

            if step % 20 == 0:
                # summary_str = sess.run(summary_op, feed_dict={inputs:batch_input, gt:batch_gt})
                summary_str = sess.run(summary_op)
                summary_writer.add_summary(summary_str, global_step=step)

            # Save the model checkpoint periodically.
            if step % 1000 == 0 or step == self.max_steps:
                checkpoint_path = os.path.join(self.train_dir, 'checkpoints')
                self.save(sess, checkpoint_path, step)

    def save(self, sess, checkpoint_dir, step):
        model_name = "deblur.model"
        if not os.path.exists(checkpoint_dir):
            os.makedirs(checkpoint_dir)
        self.saver.save(sess, os.path.join(checkpoint_dir, model_name), global_step=step)

    def load(self, sess, checkpoint_dir, step=None):
        print(" [*] Reading checkpoints...")
        model_name = "deblur.model"
        ckpt = tf.train.get_checkpoint_state(checkpoint_dir)

        if step is not None:
            ckpt_name = model_name + '-' + str(step)
            self.saver.restore(sess, os.path.join(checkpoint_dir, ckpt_name))
            print(" [*] Reading intermediate checkpoints... Success")
            return str(step)
        elif ckpt and ckpt.model_checkpoint_path:
            ckpt_name = os.path.basename(ckpt.model_checkpoint_path)
            ckpt_iter = ckpt_name.split('-')[1]
            self.saver.restore(sess, os.path.join(checkpoint_dir, ckpt_name))
            print(" [*] Reading updated checkpoints... Success")
            return ckpt_iter
        else:
            print(" [*] Reading checkpoints... ERROR")
            return False

    def test(self, height, width, input_path, output_path):
        if not os.path.exists(output_path):
            os.makedirs(output_path)
        imgsName = sorted(os.listdir(input_path))

        H, W = height, width
        inp_chns = 3 if self.args.model == 'color' else 1
        #self.batch_size = 1 if self.args.model == 'color' else 3
        self.batch_size = 1
        inputs = tf.placeholder(shape=[self.batch_size, H, W, inp_chns], dtype=tf.float32)
        outputs = self.generator(inputs, reuse=False)

        sess = tf.Session(config=tf.ConfigProto(gpu_options=tf.GPUOptions(allow_growth=True)))

        self.saver = tf.train.Saver()
        self.load(sess, self.train_dir, step=523000)

        for imgName in imgsName:
            blur = scipy.misc.imread(os.path.join(input_path, imgName))
            if self.args.model == 'gray': # gai
                blur = blur.reshape(blur.shape[0], blur.shape[1], 1)
            h, w, c = blur.shape
            # make sure the width is larger than the height
            rot = False
            if h > w:
                blur = np.transpose(blur, [1, 0, 2])
                rot = True
            h = int(blur.shape[0])
            w = int(blur.shape[1])
            resize = False
            if h > H or w > W:
                scale = min(1.0 * H / h, 1.0 * W / w)
                new_h = int(h * scale)
                new_w = int(w * scale)
                blur = scipy.misc.imresize(blur, [new_h, new_w], 'bicubic')
                resize = True
                blurPad = np.pad(blur, ((0, H - new_h), (0, W - new_w), (0, 0)), 'edge')
            else:
                blurPad = np.pad(blur, ((0, H - h), (0, W - w), (0, 0)), 'edge')
            blurPad = np.expand_dims(blurPad, 0)
            if self.args.model != 'color':
                blurPad = np.transpose(blurPad, (3, 1, 2, 0))

            start = time.time()
            deblur = sess.run(outputs, feed_dict={inputs: blurPad / 255.0})
            duration = time.time() - start
            print('Saving results: %s ... %4.3fs' % (os.path.join(output_path, imgName), duration))
            res = deblur[-1]
            if self.args.model != 'color':
                res = np.transpose(res, (3, 1, 2, 0))
            res = im2uint8(res[0, :, :, :])
            # crop the image into original size
            if resize:
                res = res[:new_h, :new_w, :]
                res = scipy.misc.imresize(res, [h, w], 'bicubic')
            else:
                res = res[:h, :w, :]

            if rot:
                res = np.transpose(res, [1, 0, 2])
                if self.args.model == 'gray': # gai
                    res = res.reshape(res.shape[0], res.shape[1])
            imgName = imgName.replace('blur', 'deblur')
            scipy.misc.imsave(os.path.join(output_path, imgName), res)

error infomation
/home/faelan/anaconda3/envs/py27/bin/python /media/faelan/WestData/code/Deblur/SRN-Deblur/run_model.py
img_in, img_gt (1, 128, 128, 1) (1, 128, 128, 1)
g_net/enc1_1/weights:0
g_net/enc1_1/biases:0
g_net/enc1_2/conv1/weights:0
g_net/enc1_2/conv1/biases:0
g_net/enc1_2/conv2/weights:0
g_net/enc1_2/conv2/biases:0
g_net/enc1_3/conv1/weights:0
g_net/enc1_3/conv1/biases:0
g_net/enc1_3/conv2/weights:0
g_net/enc1_3/conv2/biases:0
g_net/enc1_4/conv1/weights:0
g_net/enc1_4/conv1/biases:0
g_net/enc1_4/conv2/weights:0
g_net/enc1_4/conv2/biases:0
g_net/enc2_1/weights:0
g_net/enc2_1/biases:0
g_net/enc2_2/conv1/weights:0
g_net/enc2_2/conv1/biases:0
g_net/enc2_2/conv2/weights:0
g_net/enc2_2/conv2/biases:0
g_net/enc2_3/conv1/weights:0
g_net/enc2_3/conv1/biases:0
g_net/enc2_3/conv2/weights:0
g_net/enc2_3/conv2/biases:0
g_net/enc2_4/conv1/weights:0
g_net/enc2_4/conv1/biases:0
g_net/enc2_4/conv2/weights:0
g_net/enc2_4/conv2/biases:0
g_net/enc3_1/weights:0
g_net/enc3_1/biases:0
g_net/enc3_2/conv1/weights:0
g_net/enc3_2/conv1/biases:0
g_net/enc3_2/conv2/weights:0
g_net/enc3_2/conv2/biases:0
g_net/enc3_3/conv1/weights:0
g_net/enc3_3/conv1/biases:0
g_net/enc3_3/conv2/weights:0
g_net/enc3_3/conv2/biases:0
g_net/enc3_4/conv1/weights:0
g_net/enc3_4/conv1/biases:0
g_net/enc3_4/conv2/weights:0
g_net/enc3_4/conv2/biases:0
g_net/convLSTM/LSTM_conv/weights:0
g_net/convLSTM/LSTM_conv/biases:0
g_net/dec3_3/conv1/weights:0
g_net/dec3_3/conv1/biases:0
g_net/dec3_3/conv2/weights:0
g_net/dec3_3/conv2/biases:0
g_net/dec3_2/conv1/weights:0
g_net/dec3_2/conv1/biases:0
g_net/dec3_2/conv2/weights:0
g_net/dec3_2/conv2/biases:0
g_net/dec3_1/conv1/weights:0
g_net/dec3_1/conv1/biases:0
g_net/dec3_1/conv2/weights:0
g_net/dec3_1/conv2/biases:0
g_net/dec2_4/weights:0
g_net/dec2_4/biases:0
g_net/dec2_3/conv1/weights:0
g_net/dec2_3/conv1/biases:0
g_net/dec2_3/conv2/weights:0
g_net/dec2_3/conv2/biases:0
g_net/dec2_2/conv1/weights:0
g_net/dec2_2/conv1/biases:0
g_net/dec2_2/conv2/weights:0
g_net/dec2_2/conv2/biases:0
g_net/dec2_1/conv1/weights:0
g_net/dec2_1/conv1/biases:0
g_net/dec2_1/conv2/weights:0
g_net/dec2_1/conv2/biases:0
g_net/dec1_4/weights:0
g_net/dec1_4/biases:0
g_net/dec1_3/conv1/weights:0
g_net/dec1_3/conv1/biases:0
g_net/dec1_3/conv2/weights:0
g_net/dec1_3/conv2/biases:0
g_net/dec1_2/conv1/weights:0
g_net/dec1_2/conv1/biases:0
g_net/dec1_2/conv2/weights:0
g_net/dec1_2/conv2/biases:0
g_net/dec1_1/conv1/weights:0
g_net/dec1_1/conv1/biases:0
g_net/dec1_1/conv2/weights:0
g_net/dec1_1/conv2/biases:0
g_net/dec1_0/weights:0
g_net/dec1_0/biases:0
2019-11-15 18:50:58.905733: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
2019-11-15 18:50:58.985701: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:892] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2019-11-15 18:50:58.986010: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1030] Found device 0 with properties:
name: GeForce GTX 1060 6GB major: 6 minor: 1 memoryClockRate(GHz): 1.8095
pciBusID: 0000:0c:00.0
totalMemory: 5.93GiB freeMemory: 5.49GiB
2019-11-15 18:50:58.986029: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1120] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: GeForce GTX 1060 6GB, pci bus id: 0000:0c:00.0, compute capability: 6.1)
2019-11-15 18:51:00.790961: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Number of channels must be 3 or 4, was 1
         [[Node: input/decode_image/cond_jpeg/cond_png/cond_gif/DecodeBmp = DecodeBmp[channels=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/decode_image/cond_jpeg/cond_png/cond_gif/Substr/Switch, ^input/decode_image/cond_jpeg/cond_png/cond_gif/Assert_1/Assert, ^input/decode_image/cond_jpeg/cond_png/cond_gif/Assert_2/Assert)]]
2019-11-15 18:51:00.834833: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Number of channels must be 3 or 4, was 1
         [[Node: input/decode_image_1/cond_jpeg/cond_png/cond_gif/DecodeBmp = DecodeBmp[channels=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/decode_image_1/cond_jpeg/cond_png/cond_gif/Substr/Switch, ^input/decode_image_1/cond_jpeg/cond_png/cond_gif/Assert_1/Assert, ^input/decode_image_1/cond_jpeg/cond_png/cond_gif/Assert_2/Assert)]]
2019-11-15 18:51:00.835682: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Number of channels must be 3 or 4, was 1
         [[Node: input/decode_image/cond_jpeg/cond_png/cond_gif/DecodeBmp = DecodeBmp[channels=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/decode_image/cond_jpeg/cond_png/cond_gif/Substr/Switch, ^input/decode_image/cond_jpeg/cond_png/cond_gif/Assert_1/Assert, ^input/decode_image/cond_jpeg/cond_png/cond_gif/Assert_2/Assert)]]
2019-11-15 18:51:00.837560: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Number of channels must be 3 or 4, was 1
         [[Node: input/decode_image/cond_jpeg/cond_png/cond_gif/DecodeBmp = DecodeBmp[channels=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/decode_image/cond_jpeg/cond_png/cond_gif/Substr/Switch, ^input/decode_image/cond_jpeg/cond_png/cond_gif/Assert_1/Assert, ^input/decode_image/cond_jpeg/cond_png/cond_gif/Assert_2/Assert)]]
2019-11-15 18:51:00.837569: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Number of channels must be 3 or 4, was 1
         [[Node: input/decode_image/cond_jpeg/cond_png/cond_gif/DecodeBmp = DecodeBmp[channels=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/decode_image/cond_jpeg/cond_png/cond_gif/Substr/Switch, ^input/decode_image/cond_jpeg/cond_png/cond_gif/Assert_1/Assert, ^input/decode_image/cond_jpeg/cond_png/cond_gif/Assert_2/Assert)]]
2019-11-15 18:51:00.837582: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Number of channels must be 3 or 4, was 1
         [[Node: input/decode_image/cond_jpeg/cond_png/cond_gif/DecodeBmp = DecodeBmp[channels=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/decode_image/cond_jpeg/cond_png/cond_gif/Substr/Switch, ^input/decode_image/cond_jpeg/cond_png/cond_gif/Assert_1/Assert, ^input/decode_image/cond_jpeg/cond_png/cond_gif/Assert_2/Assert)]]
2019-11-15 18:51:00.837729: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Number of channels must be 3 or 4, was 1
         [[Node: input/decode_image_1/cond_jpeg/cond_png/cond_gif/DecodeBmp = DecodeBmp[channels=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/decode_image_1/cond_jpeg/cond_png/cond_gif/Substr/Switch, ^input/decode_image_1/cond_jpeg/cond_png/cond_gif/Assert_1/Assert, ^input/decode_image_1/cond_jpeg/cond_png/cond_gif/Assert_2/Assert)]]
2019-11-15 18:51:00.837744: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Number of channels must be 3 or 4, was 1
         [[Node: input/decode_image_1/cond_jpeg/cond_png/cond_gif/DecodeBmp = DecodeBmp[channels=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/decode_image_1/cond_jpeg/cond_png/cond_gif/Substr/Switch, ^input/decode_image_1/cond_jpeg/cond_png/cond_gif/Assert_1/Assert, ^input/decode_image_1/cond_jpeg/cond_png/cond_gif/Assert_2/Assert)]]
2019-11-15 18:51:00.837721: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Number of channels must be 3 or 4, was 1
         [[Node: input/decode_image_1/cond_jpeg/cond_png/cond_gif/DecodeBmp = DecodeBmp[channels=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/decode_image_1/cond_jpeg/cond_png/cond_gif/Substr/Switch, ^input/decode_image_1/cond_jpeg/cond_png/cond_gif/Assert_1/Assert, ^input/decode_image_1/cond_jpeg/cond_png/cond_gif/Assert_2/Assert)]]
2019-11-15 18:51:00.838160: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Number of channels must be 3 or 4, was 1
         [[Node: input/decode_image_1/cond_jpeg/cond_png/cond_gif/DecodeBmp = DecodeBmp[channels=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/decode_image_1/cond_jpeg/cond_png/cond_gif/Substr/Switch, ^input/decode_image_1/cond_jpeg/cond_png/cond_gif/Assert_1/Assert, ^input/decode_image_1/cond_jpeg/cond_png/cond_gif/Assert_2/Assert)]]
2019-11-15 18:51:00.838148: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Number of channels must be 3 or 4, was 1
         [[Node: input/decode_image/cond_jpeg/cond_png/cond_gif/DecodeBmp = DecodeBmp[channels=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/decode_image/cond_jpeg/cond_png/cond_gif/Substr/Switch, ^input/decode_image/cond_jpeg/cond_png/cond_gif/Assert_1/Assert, ^input/decode_image/cond_jpeg/cond_png/cond_gif/Assert_2/Assert)]]
2019-11-15 18:51:00.838247: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Number of channels must be 3 or 4, was 1
         [[Node: input/decode_image_1/cond_jpeg/cond_png/cond_gif/DecodeBmp = DecodeBmp[channels=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/decode_image_1/cond_jpeg/cond_png/cond_gif/Substr/Switch, ^input/decode_image_1/cond_jpeg/cond_png/cond_gif/Assert_1/Assert, ^input/decode_image_1/cond_jpeg/cond_png/cond_gif/Assert_2/Assert)]]
2019-11-15 18:51:00.838156: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Number of channels must be 3 or 4, was 1
         [[Node: input/decode_image/cond_jpeg/cond_png/cond_gif/DecodeBmp = DecodeBmp[channels=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/decode_image/cond_jpeg/cond_png/cond_gif/Substr/Switch, ^input/decode_image/cond_jpeg/cond_png/cond_gif/Assert_1/Assert, ^input/decode_image/cond_jpeg/cond_png/cond_gif/Assert_2/Assert)]]
2019-11-15 18:51:00.838156: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Number of channels must be 3 or 4, was 1
         [[Node: input/decode_image/cond_jpeg/cond_png/cond_gif/DecodeBmp = DecodeBmp[channels=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/decode_image/cond_jpeg/cond_png/cond_gif/Substr/Switch, ^input/decode_image/cond_jpeg/cond_png/cond_gif/Assert_1/Assert, ^input/decode_image/cond_jpeg/cond_png/cond_gif/Assert_2/Assert)]]
2019-11-15 18:51:00.838317: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Number of channels must be 3 or 4, was 1
         [[Node: input/decode_image_1/cond_jpeg/cond_png/cond_gif/DecodeBmp = DecodeBmp[channels=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/decode_image_1/cond_jpeg/cond_png/cond_gif/Substr/Switch, ^input/decode_image_1/cond_jpeg/cond_png/cond_gif/Assert_1/Assert, ^input/decode_image_1/cond_jpeg/cond_png/cond_gif/Assert_2/Assert)]]
2019-11-15 18:51:00.838385: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Number of channels must be 3 or 4, was 1
         [[Node: input/decode_image_1/cond_jpeg/cond_png/cond_gif/DecodeBmp = DecodeBmp[channels=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/decode_image_1/cond_jpeg/cond_png/cond_gif/Substr/Switch, ^input/decode_image_1/cond_jpeg/cond_png/cond_gif/Assert_1/Assert, ^input/decode_image_1/cond_jpeg/cond_png/cond_gif/Assert_2/Assert)]]
2019-11-15 18:51:00.838392: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Number of channels must be 3 or 4, was 1
         [[Node: input/decode_image_1/cond_jpeg/cond_png/cond_gif/DecodeBmp = DecodeBmp[channels=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/decode_image_1/cond_jpeg/cond_png/cond_gif/Substr/Switch, ^input/decode_image_1/cond_jpeg/cond_png/cond_gif/Assert_1/Assert, ^input/decode_image_1/cond_jpeg/cond_png/cond_gif/Assert_2/Assert)]]
2019-11-15 18:51:00.838418: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Number of channels must be 3 or 4, was 1
         [[Node: input/decode_image/cond_jpeg/cond_png/cond_gif/DecodeBmp = DecodeBmp[channels=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/decode_image/cond_jpeg/cond_png/cond_gif/Substr/Switch, ^input/decode_image/cond_jpeg/cond_png/cond_gif/Assert_1/Assert, ^input/decode_image/cond_jpeg/cond_png/cond_gif/Assert_2/Assert)]]
2019-11-15 18:51:00.838435: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Number of channels must be 3 or 4, was 1
         [[Node: input/decode_image_1/cond_jpeg/cond_png/cond_gif/DecodeBmp = DecodeBmp[channels=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/decode_image_1/cond_jpeg/cond_png/cond_gif/Substr/Switch, ^input/decode_image_1/cond_jpeg/cond_png/cond_gif/Assert_1/Assert, ^input/decode_image_1/cond_jpeg/cond_png/cond_gif/Assert_2/Assert)]]
2019-11-15 18:51:00.846275: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Number of channels must be 3 or 4, was 1
         [[Node: input/decode_image_1/cond_jpeg/cond_png/cond_gif/DecodeBmp = DecodeBmp[channels=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/decode_image_1/cond_jpeg/cond_png/cond_gif/Substr/Switch, ^input/decode_image_1/cond_jpeg/cond_png/cond_gif/Assert_1/Assert, ^input/decode_image_1/cond_jpeg/cond_png/cond_gif/Assert_2/Assert)]]
2019-11-15 18:51:00.846288: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Number of channels must be 3 or 4, was 1
         [[Node: input/decode_image_1/cond_jpeg/cond_png/cond_gif/DecodeBmp = DecodeBmp[channels=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/decode_image_1/cond_jpeg/cond_png/cond_gif/Substr/Switch, ^input/decode_image_1/cond_jpeg/cond_png/cond_gif/Assert_1/Assert, ^input/decode_image_1/cond_jpeg/cond_png/cond_gif/Assert_2/Assert)]]
2019-11-15 18:51:00.893219: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Number of channels must be 3 or 4, was 1
         [[Node: input/decode_image/cond_jpeg/cond_png/cond_gif/DecodeBmp = DecodeBmp[channels=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/decode_image/cond_jpeg/cond_png/cond_gif/Substr/Switch, ^input/decode_image/cond_jpeg/cond_png/cond_gif/Assert_1/Assert, ^input/decode_image/cond_jpeg/cond_png/cond_gif/Assert_2/Assert)]]
2019-11-15 18:51:00.893239: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Number of channels must be 3 or 4, was 1
         [[Node: input/decode_image/cond_jpeg/cond_png/cond_gif/DecodeBmp = DecodeBmp[channels=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/decode_image/cond_jpeg/cond_png/cond_gif/Substr/Switch, ^input/decode_image/cond_jpeg/cond_png/cond_gif/Assert_1/Assert, ^input/decode_image/cond_jpeg/cond_png/cond_gif/Assert_2/Assert)]]
Traceback (most recent call last):
  File "/media/faelan/WestData/code/Deblur/SRN-Deblur/run_model.py", line 54, in <module>
    tf.app.run()
  File "/home/faelan/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "/media/faelan/WestData/code/Deblur/SRN-Deblur/run_model.py", line 48, in main
    deblur.train()
  File "/media/faelan/WestData/code/Deblur/SRN-Deblur/models/model.py", line 214, in train
    _, loss_total_val = sess.run([train_gnet, self.loss_total])
  File "/home/faelan/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 889, in run
    run_metadata_ptr)
  File "/home/faelan/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1120, in _run
    feed_dict_tensor, options, run_metadata)
  File "/home/faelan/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1317, in _do_run
    options, run_metadata)
  File "/home/faelan/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1336, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.OutOfRangeError: FIFOQueue '_1_input/batch/fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
         [[Node: input/batch = QueueDequeueManyV2[component_types=[DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/batch/fifo_queue, input/batch/n)]]

Caused by op u'input/batch', defined at:
  File "/media/faelan/WestData/code/Deblur/SRN-Deblur/run_model.py", line 54, in <module>
    tf.app.run()
  File "/home/faelan/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "/media/faelan/WestData/code/Deblur/SRN-Deblur/run_model.py", line 48, in main
    deblur.train()
  File "/media/faelan/WestData/code/Deblur/SRN-Deblur/models/model.py", line 186, in train
    self.build_model() # TODO
  File "/media/faelan/WestData/code/Deblur/SRN-Deblur/models/model.py", line 137, in build_model
    img_in, img_gt = self.input_producer(self.batch_size)
  File "/media/faelan/WestData/code/Deblur/SRN-Deblur/models/model.py", line 64, in input_producer
    batch_in, batch_gt = tf.train.batch([image_in, image_gt], batch_size=batch_size, num_threads=8, capacity=20)
  File "/home/faelan/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/training/input.py", line 927, in batch
    name=name)
  File "/home/faelan/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/training/input.py", line 722, in _batch
    dequeued = queue.dequeue_many(batch_size, name=name)
  File "/home/faelan/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/ops/data_flow_ops.py", line 464, in dequeue_many
    self._queue_ref, n=n, component_types=self._dtypes, name=name)
  File "/home/faelan/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/ops/gen_data_flow_ops.py", line 2418, in _queue_dequeue_many_v2
    component_types=component_types, timeout_ms=timeout_ms, name=name)
  File "/home/faelan/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
    op_def=op_def)
  File "/home/faelan/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2956, in create_op
    op_def=op_def)
  File "/home/faelan/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1470, in __init__
    self._traceback = self._graph._extract_stack()  # pylint: disable=protected-access

OutOfRangeError (see above for traceback): FIFOQueue '_1_input/batch/fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
         [[Node: input/batch = QueueDequeueManyV2[component_types=[DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/device:CPU:0"](input/batch/fifo_queue, input/batch/n)]]

Three options have been given in the original code. If they are not color options, they all have to be grayscale and then processed. Is the grayscale image that you enter directly?

According to the last line of error code, the TensorFlow data pipeline cannot read image data.

Maybe you provide the wrong path to images, or maybe your data fail to pass preprocessing part.

Please check https://github.com/jiangsutx/SRN-Deblur/blob/master/models/model.py#L37-L63
And TensorFlow data pipeline is really hard to debug.

Please check https://github.com/jiangsutx/SRN-Deblur/blob/master/models/model.py#L39-L41
It seems that you are using newer version of TensorFlow and make sure tf.image_decode has correct parameters.

Thank you for your reply!
I'm sure that the path of images are right, because the code runs well with RGB images.
The code runs with tensorflow-gpu 1.4.0.
I fork this repository and uploaded my dataset at SRN-Deblur.
Would you like to help me to debug the code? I will be very appreciate.

1.Option"model" should be "gray"
2.Training set should be grayscale images.
3. "Channels"should be 3 not 0.
def input_producer(self, batch_size=10):
        def read_data():
            img_a = tf.image.decode_image(tf.read_file(tf.string_join(['./training_set/', self.data_queue[0]])),
                                          channels=0)
            img_b = tf.image.decode_image(tf.read_file(tf.string_join(['./training_set/', self.data_queue[1]])),
                                          channels=0)

I have trained grayscale images successfully.

1.Option"model" should be "gray"
2.Training set should be grayscale images.
3. "Channels"should be 3 not 0.
def input_producer(self, batch_size=10):
        def read_data():
            img_a = tf.image.decode_image(tf.read_file(tf.string_join(['./training_set/', self.data_queue[0]])),
                                          channels=0)
            img_b = tf.image.decode_image(tf.read_file(tf.string_join(['./training_set/', self.data_queue[1]])),
                                          channels=0)

I have trained grayscale images successfully.

Thanks, I used grayscale images, set Channels to 0 and set model =gray. The error may caused by my images' encoding. I will try it. You help me a lot!

The code is no error, my dataset has some problems. The code runs well with another dataset. Thank you!