primordic/IssueDupesLite huggingface dataset:
Repository: python-geeks/Automation-scripts

Issue #548: Text Encryptor and Decryptor using AES
Created: 2021-10-01T16:54:55Z
Script Title - Text Encryptor and Decryptor using AES
Brief - A script which will encrypt/decrypt the text using the password.
Instructions

Create a new folder for your script and file/folder name should be appropriate.
Create a README.md in your folder for program Instructions
add requirements.txt if needed

Programming Language

 Python

Happy Coding

Duplicate issue #625: Add a Hacker News Scraper script.
Created: 2021-10-05T11:58:20Z
Script Title - hackernews_scraper
Brief - A script that scrapes the exact count of news that the user demands and stores it in a csv file.
Instructions

Create a new folder for your script and file/folder name should be appropriate.
Create a README.md in your folder for program Instructions
add requirements.txt if needed

Programming Language

 Python

Happy Coding

Closing comment (2021-10-05T12:01:10Z): possible duplicate of #548
Repository: python-geeks/Automation-scripts

Issue #21: Converting sound/voice to text
Created: 2020-10-08T06:04:23Z
Script Title - Able to convert sound to its text. Can be done using "librosa" library
what will change - Adding script of voice_to_text convertor
Instructions

Create a new folder for your script and the file/folder name should be appropriate.
Create a README.md in your folder for program Instructions
add requirements.txt if needed

Please add/delete options that are not relevant.

 Adding New Code

Programming Language

 Python

Happy Coding,

Duplicate issue #633: speech to text program
Created: 2021-10-06T04:49:47Z
a program to convert speech to text

Closing comment (2021-10-06T05:37:51Z): Duplicate of #21
Repository: python-geeks/Automation-scripts

Issue #219: File arranger
Created: 2020-10-11T11:26:03Z
Script Title - Files arranged according to extension in respective folders
what will change - Adding script
Instructions

Create a new folder for your script and file/folder name should be appropriate.
Create a README.md in your folder for program Instructions
add requirements.txt if needed

Please add/delete options that are not relevant.

 Adding New Code

Programming Language

 Python

Happy Coding,

Duplicate issue #396: Manage Files
Created: 2021-08-22T04:25:37Z
Script Title -
I would like to create a script to manage files in a particular folder (especially the Download folder)
Generally, we download most of the things from the web and when we need to find them after some days it is sometimes hard.
So, what my script does will separate the files in a different folder like music files in one folder documents in another, and all other extensions like .exe .zip accordingly
Instructions

Create a new folder for your script and the file/folder name should be appropriate.
Create a README.md in your folder for program Instructions
add requirements.txt if needed

Programming Language

 Python

Happy Coding

Closing comment (2021-08-22T17:08:08Z): Duplicate of #219
Repository: python-geeks/Automation-scripts

Issue #219: File arranger
Created: 2020-10-11T11:26:03Z
Script Title - Files arranged according to extension in respective folders
what will change - Adding script
Instructions

Create a new folder for your script and file/folder name should be appropriate.
Create a README.md in your folder for program Instructions
add requirements.txt if needed

Please add/delete options that are not relevant.

 Adding New Code

Programming Language

 Python

Happy Coding,

Duplicate issue #499: Sort Bulk Files Automation
Created: 2021-10-01T04:07:14Z
Sort Bulk Files Automation
Brief -
The script will be run in a folder full of random files and sort them based on there file types and names in each separate folder.
Instructions

Create a new folder for your script and file/folder name should be appropriate.
Create a README.md in your folder for program Instructions
add requirements.txt if needed

Programming Language

 Python

Happy Coding

Closing comment (2021-10-01T04:12:47Z): Hey, isn't it same as #219 ?
Repository: python-trio/trio

Issue #421: Add an example to the tutorial that demonstrates collecting results from tasks
Created: 2018-01-27T03:16:00Z
For example, maybe something like:
https://gist.github.com/njsmith/986b0d0e04c3b2bb45de5d662ae873d5
Or the same but with results[i] = await trio.hazmat.Result.acapture(async_fn).

Duplicate issue #1483: Add webscraping tutorial (OR: arbitrary number of returns from nursery)
Created: 2020-04-30T12:27:03Z
I'm new to trio, but it seems to me to be the cleanest approach to async programming in python. :)
So when I had a little task of grabbing a bunch of things from the web I automatically thought I'd try it, but ran into problems straight away. Even if the solution to my problem ends up being trivial, I'm maybe a good example of someone looking at the tutorial and trying to build their first toy example (the issue title can be adapted accordingly).
Let's say I have my function:
async def get_shiny_thing(url)
    some_shiny_thing = await asks.get(url)
    # some processing
    return some_shiny_thing
All I really want to do is (knowing that the order is indeterminate):
with trio.open_nursery() as nursery:
    my_treasure = [nursery.start_soon(get_shiny_thing, url) for url in list_of_urls]
This fails with RuntimeError: use 'async with open_nursery(...)', not 'with open_nursery(...)'
Next step: a wrapper function:
async def get_treasure(generic_list):
    async with trio.open_nursery() as nursery:
        generic_treasure = [nursery.start_soon(get_shiny_thing, url)
                            for url in generic_list]
    return generic_treasure
But then - gasp! - my_treasure is empty:
>>> my_treasure = get_treasure(list_of_urls)
>>> my_treasure 
[None, None, None, None, None]

I tested that get_shiny_thing actually does what it should. Next, I then found this SO answer from 2018 by @njsmith, how what I want to do is not really possible (yet?). But the workaround of creating separate functions that update each url (in a dict?) separately and then get passed to start_soon seems cumbersome, even if I built a "function factory".
In short: one of the most generic & popular async examples (a little web scraping) should IMO be one of the things in a tutorial. The tutorial even notes this absence:

(Probably a more relevant example these days would be an application that does lots of concurrent HTTP requests, but for that you need an HTTP library such as asks, so we’ll stick with the echo server tradition.)

If hip isn't ready yet, then it's maybe worth considering just doing that example with asks.

Closing comment (2020-05-12T09:31:03Z): I think the remaining action item here is a duplicate of #421.
Repository: python-trio/trio

Issue #2183: trio's guest mode breaks sniffio.current_async_library in certain cases
Created: 2021-11-25T14:20:25Z
I am opening this bug as requested on Gitter (see link below).
Summary
When running trio as a guest (in a tkinter event loop in this case), and using trio.Nursery::start_soon() from the host event loop to schedule work to be done in the trio event loop, sniffio.current_async_library() doesn't detect the trio loop and raises.
Details
When running trio in guest mode in the tkinter event loop, the docs advise to have both loop have the same lifetime. This is achieved by passing a done_callback to trio.start_guest_run() that terminates the host loop. The closing mechanism is then to terminate the trio loop (most likely by cancelling it), which in turn terminates the host loop.
The doc does not provide examples on how to start async function inside the trio loop from the host loop. When reading it, it was unclear to me what functions or methods are safe to call from outside the trio loop. I considered trio.Nursery::start_soon, trio.SendChannel::put_nowait(), trio.lowlevel.TrioToken::run_sync_soon() and trio.lowlevel.spawn_system_task().
As nurseries seemed like an excellent control flow mechanism and a central concept in trio, I tried the Nursery. A Nursery is created in the trio loop, immediately calls nursery.start_soon(trio.sleep_forever) to remain available, and the host loop gets a reference to this nursery to schedule async function in it.
This works for trio code, but seem to breaks sniffio.current_async_library(), which raises an exception. I my particular use-case, sniffio was used under the hood by asks, which was used for http requests.
I wrote a (relatively) small example code to showcase the issue, as well as the fix proposed on Gitter. See the link below.
I am unsure if this is an actual bug in sniffio, or trio guest mode, or bad code on my part.
Maybe the doc of trio.lowlevel.start_guest_run() could be improved to show how to do this correctly (e.g. using memory channels), so as to avoid future confusion or unsafe code.
Additional resources

discussion on gitter https://gitter.im/python-trio/general?at=619f8ac5c6149e53494c05b7
reproducing code: https://gist.github.com/QuentinSoubeyran/138f0784f9d596f5727ca2bea830ffcd

Versions:

OS: Ubuntu 20.04
python 3.10
trio 0.19.0
sniffio 1.2.0

If any info is missing, I'll gladly improve this issue !
Words of thank
Thank you all for the trio lib, it looks awesome ! I was extremely glade to find about guest mode, it really feels like the correct way to use async I/O and a UI together.

Duplicate issue #2461: A nursery crashes during a guest run when the host loop calls `start_soon(needs_sniffio)`
Created: 2022-11-05T06:21:58Z
Hi!
I found this bug while using AnyIO with Trio guest runs on Qt event loops. A minimal reproducer is at b6e0f7f.

Closing comment (2022-12-20T09:52:34Z): this is a duplicate of #2183—I must have missed it when searching.
Repository: python-trio/trio

Issue #472: Add collection of worked examples to tutorial
Created: 2018-03-16T19:47:29Z
We should refactor the tutorial into an initial part that's similar to what we have now, or the middle part of my talk, and then a collection of examples that also serve as excuses to go into more depth on particular topics.
I expect the list will grow over time, but here are some ideas. (Actually the main reason I'm filing this is to have a place collect these so I don't lose them.)


The current tracing demo should move here. It's a good intro to trio introspection and to co-op concurrency, but having it in the main tutorial like it is now is a big blob of text for folks to wade through if they already know this stuff. (We can/should link to it from the async/await intro though.)


Happy eyeballs (for people who saw the talk but want a text version; as a demo of passing nursery objects around; ...)


Multiplexing rpc (#467)


Catch-all exception handler


Custom nursery, like a race function or ignore-errors nursery (maybe both)


Some standard stuff like echo server, proxy, fast web spider, ... Whatever doesn't end up in the main tutorial. (We could have echo server and TCP proxy as two examples, then show how to run them both within a single process as an example of implementing multi-protocol servers... and also to show off how proxy_one_way can be re-used for both! Maybe the proxy should demonstrate mirroring localhost:12345 to httpbin:80, so people can try it out with their web browsers?)


trio-asyncio example?


nursery.start


Possibly some of these could be combined or form sequences, eg echo server -> catch all handler -> nursery.start

Duplicate issue #1291: How-to guides
Created: 2019-11-04T21:18:51Z
"What nobody tells you about documentation" distinguishes four types of documentation:

tutorials,
how-to guides,
explanation,
reference.

Of these, Trio docs are weakest on the "how-to guides" section. Currently there are a lot of hidden gems in chat, gists, and issues. That may be because Trio's evolving too quickly to have a stable set of how-tos. But as the API settles it would be nice to have vetted answers to common "how do I ___?" situations.
Even before 1.0 it would be nice to display the current status of each how-to so I don't have to keep track of the mental bookmarks I've saved for each task, and ask on chat to makes sure the 2-year-old gist is still the preferred way.
Also nice: having recommendations tested in CI so they don't fall out of date.
That includes how-tos which may involve third-party libraries, like triopg or asyncssh.
Some examples include: "How do I"...

make line streams
crawl the web
schedule jobs
make a Trionic process-pool executor
interact with a repl, pexpect-style
and many more...

Closing comment (2019-11-04T21:57:50Z): I think this is a duplicate of #472?
Repository: python-trio/trio

Issue #2485: Incorrect version in trio/_version.py on v0.22.0 tag
Created: 2022-11-26T15:29:21Z
When checking out trio from the v0.22.0 tag, https://github.com/python-trio/trio/blob/v0.22.0/trio/_version.py incorrectly states the version as:
__version__ = "0.21.0+dev"

Noticed this because we use GitHub archives for packaging on Gentoo, and trio ended up being installed as 0.21.0+dev, therefore breaking version constraints in other packages.

Duplicate issue #2583: 0.22.0: version not updated
Created: 2023-03-01T11:54:12Z
Looks like trio.__vesion__ has not been updated before tagging
https://github.com/python-trio/trio/blob/v0.22.0/trio/_version.py#L1-L3

Closing comment (2023-03-07T07:48:17Z): This is a duplicate of #2485. I did not get to make a release, would you like to give it a try @A5rocks?
Repository: python-trio/trio

Issue #455: Cancelled __aexit__ handlers eat exceptions
Created: 2018-02-22T20:42:41Z
This is what happens when you don't wrap your async context's exit handler in a shielded cancel scope:
… trick question. Nothing happens – the error gets dropped on the floor. Since this is a fairly common mistake (at least IME) I wonder whether we can do something about it. If not (which is what I suspect) we need to document this pitfall more loudly.
import trio

class bar:
    async def __aenter__(self):
        return self
    async def __aexit__(self, *tb):
        await trio.sleep(0)

async def foo():
    with trio.open_cancel_scope() as s:
        async with bar():
            s.cancel()
            raise RuntimeError("Duh")

trio.run(foo)

Duplicate issue #746: Channel context manager eats exceptions when cancelled
Created: 2018-10-22T19:37:22Z
I ran into this today:
import trio

async def produce(send_channel):
    async with send_channel:
        print("in async with send_channel")
        raise RuntimeError("kaboom")

async def test():
    send_channel, receive_channel = trio.open_memory_channel(0)
    with trio.open_cancel_scope() as scope:
        scope.cancel()
        await produce(send_channel)

trio.run(test)
print("where's the kaboom?")

Prints:
in async with send_channel
where's the kaboom?

I'm guessing this is because channel.aclose() is a checkpoint? Seems like this exception-eating might be the same or an overlapping issue as #455, but it was especially surprising to me, and I think might create user confusion as people start using async with foo_channel: in more and more places.

Closing comment (2018-10-23T04:08:18Z): Yeah, this is exactly the same as #455, so I'll close it to consolidate the discussion.
Repository: pythonnet/pythonnet

Issue #1432: how cant i get the print in PythonEngine.Exec("print('123')"); i want to get 123 when i use PythonEngine.Exec
Created: 2021-04-02T07:13:31Z
Environment

Pythonnet version:
Python version:
Operating System:
.NET Runtime:

Details


Describe what you were trying to get done.
TODO


What commands did you run to trigger this issue? If you can provide a
Minimal, Complete, and Verifiable example
this will help us understand the issue.


    print('TODO')

If there was a crash, please include the traceback here.

    print('TODO')

Duplicate issue #1433: how cant i get the print in PythonEngine.Exec("print('123')"); i want to get the content  when i use PythonEngine.Exec to print
Created: 2021-04-02T07:38:17Z
Environment

Pythonnet version:3.8
Python version:3.8
Operating System:windows64
.NET Runtime:framework4.7

Details


i want to get the print content when i use PythonEngine.Exec to implement python
TODO


What commands did you run to trigger this issue? If you can provide a
Minimal, Complete, and Verifiable example
this will help us understand the issue.




how can i get 123?
    print('TODO')

If there was a crash, please include the traceback here.

    print('TODO')

Closing comment (2021-04-02T07:40:43Z): Duplicate of #1432
Repository: pythonnet/pythonnet

Issue #703: Very Slow Python Initialize
Created: 2018-07-12T19:53:04Z
Environment
Pythonnet version: 2.3.0
Python version: Python 3.5 (conda environment)
Operating System: Windows 10 64bit
VS 2017
Details
Hi guys, thanks for the great work building a super useful library. One question, and this could be expected behavior, I'm not sure. When I initialize the python interpreter on the .Net side, with this call:
using (Py.GIL()) {
I've timed it and it takes about 2 mins to complete the call. Further calls to grab python lock return immediately. I've also noticed that in visual studio my output window I see thousands of messages of this form:

Exception thrown at 0x00007FFE37F73C58 in RSUser.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x000000314CBFB8F0.
Exception thrown at 0x00007FFE37F73C58 in RSUser.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
Exception thrown at 0x00007FFE37F73C58 in RSUser.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x000000314CBFB8F0.
Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.dll
Exception thrown at 0x00007FFE37F73C58 in RSUser.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x000000314CBFB8F0.
Exception thrown at 0x00007FFE37F73C58 in RSUser.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.

Duplicate issue #713: c# implementation gives a bunch of exceptions
Created: 2018-08-08T11:49:53Z
Environment

Pythonnet version:2.3.0
Python version:3.6(Anaconda)
Operating System:Windows 10

Details
Im just running an empty console application on c# to test pythonnet out. it works fine and all but it takes a while to load up because of all the exceptions its throwing within those few seconds. I even just have an empty code block.
static void Main(string[] args)
        {
            using (Py.GIL())
            {

            }
            Console.ReadLine();
        }

This is the exception thrown and it goes on  for around 3 seconds
Exception caught: 'System.IO.FileLoadException' in Python.Runtime.dll 
("Could not load file or assembly '__StaticArrayInitTypeSize\=44' or one of its dependencies. 
The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)")

Closing comment (2018-08-09T18:49:42Z): This sounds to me like a duplicate of #703, do you agree?
Repository: pythonnet/pythonnet

Issue #2107: PythonEngine.Shutdown() Crash
Created: 2023-02-20T15:19:35Z
Environment

Pythonnet version: 3.0.1
Python version: 3.7.3
Operating System: Windows 11 (Same happens when running on WSL - Ubuntu)
.NET Runtime: .NET 7

Details
Calling Python.Runtime.PythonEngine.Shutdown(); results in the error:
System.NotSupportedException: 'BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information.'

Duplicate issue #2149: NotSupportedException on PythonEngine.Shutdown()
Created: 2023-05-03T09:46:01Z
Environment

Pythonnet version: 3.0.1
Python version: 3.9
Operating System: Debian GNU/Linux 11 (bullseye)
.NET Runtime: 7.0.5

Details

Describe what you were trying to get done.

I'm invoking PythonEngine.Shutdown(), which throws an exception: 'NotSupportedException: 'BinaryFormatter serialization and deserialization are disabled within this application'.
I can work around this by adding the following to my project file:
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
I'm nervous about this because Microsoft has decreed it to be 'unsafe'. Is there a better way?

Closing comment (2023-05-03T16:44:37Z): Duplicate of #2107
See workaround ^
Repository: pythonnet/pythonnet

Issue #72: Add support for DLR types
Created: 2015-04-16T18:22:05Z
Using this it's possible to implement all required functionality in a separate DLR meta-class. I've already tried to do this in Python but sadly the .NET types (or their representation in Python-space) are not patchable.

Duplicate issue #1217: pythonnet should support calling methods on C# objects derived from DynamicObject and members exposed via TryGetMember / TryInvoke 
Created: 2020-09-06T23:11:49Z
Environment

Pythonnet version: latest
Python version: latest
Operating System: Windows 10

Details
If a C# class exposes properties and methods dynamically, such as when the information isn't available at compile time, it derives from DynamicObject and overrides TryGetMember and TryInvoke (or TryInvokeMember).
These types of methods and properties aren't accessible from Python.NET

Right now, it says the attribute is missing.  Instead, Python.NET should see if the CLR object is derived from DynamicObject , and if so, call TryGetMember  on it, then call TryInvoke on that.   I'm not sure methods exposed via TryInvokeMember will work, but I'm not sure.    But Python.NET can at least implement calling properties and methods exposed via TryGetMember  / TryInvoke.

Take a look at the example sample class "DynamicNumber" in MSDN:
https://docs.microsoft.com/en-us/dotnet/api/system.dynamic.dynamicobject.tryinvoke?view=netcore-3.1
That class exposed publicly via a C# assembly should be usable from Python.NET
Also "DynamicDictionary" is another example at https://docs.microsoft.com/en-us/dotnet/api/system.dynamic.dynamicobject.tryinvokemember?view=netcore-3.1
The rest of the Try members can also be implemented, incrementally, to add more and more functionality.   But supporting TryGetMember and TryInvoke would be minimum required.

Closing comment (2020-09-07T10:29:03Z): This is a duplicate of #72. There is also a workaround for types deriving from DynamicObject (which should be most dynamic types) in that thread.
Repository: pytorch/audio

Issue #689: Revise parameters for Kaldi mfcc compatibility test
Created: 2020-06-04T13:15:31Z
Similar to #679
We should also revise the parameters for mfcc test.
See also #681

Duplicate issue #686: 🚀 Feature Request: Add Kaldi Pitch Feature
Created: 2020-06-04T01:37:30Z
🚀 Feature
Add feature that is equivalent to Kaldi's compute-kaldi-pitch-feats.
Motivation
From #679 (comment)

We found that the pitch feature always improved the performance for several tonal languages (e.g., Chinese), and did not degrade the performance for the other languages.
So, espnet1 decided to use log Mel filterbank + pitch features as default.
However, the pitch feature extraction is rather complicated, and we had some difficulties in making this pitch feature extraction fully written by torch functions.
So, espnet2 decided to only use log Mel filterbank features, instead.
We still observe a slight degradation of the ASR performance, but that can be mitigated by some tuning.
We're now moving to espnet2 so we don't need it in the long term, but probably it is quite beneficial for the short term or people keep to use espnet1.

Closing comment (2020-06-15T15:53:12Z): Some thoughts on spec:
Interface
def compute_pitch_feats(
        waveform: Tensor,
        delta_pitch: float = 0.005,
        frame_length: float = 25.,
        frame_shift: float = 10.,
        frames_per_chunk: int = 0,
        lowpass_cutoff: float = 1000.,
        lowpass_filter_width: int = 1,
        max_f0: float = 400.,
        max_frames_latency: int = 0,
        min_f0: float = 50.,
        nccf_ballast: float = 7000.,
        nccf_ballast_online: bool = False,
        penalty_factor: float = 0.1,
        recompute_frame: int = 500,
        resample_frequency: float = 4000,
        sample_frequency: float = 16000,
        simulate_first_pass_online: bool = False,
        snip_edges: bool = True,
        soft_min_f0: float = 10.,
        upsample_filter_width: int = 5,
) -> Tensor:
    ...

Implementation

https://github.com/kaldi-asr/kaldi/blob/75872d8548b10501d73ebebbc8dfeddfc13a175d/src/featbin/compute-kaldi-pitch-feats.cc#L97
-> https://github.com/kaldi-asr/kaldi/blob/75872d8548b10501d73ebebbc8dfeddfc13a175d/src/feat/pitch-functions.h#L411-L419
-> https://github.com/kaldi-asr/kaldi/blob/75872d8548b10501d73ebebbc8dfeddfc13a175d/src/feat/pitch-functions.cc#L1291-L1327
-> https://github.com/kaldi-asr/kaldi/blob/75872d8548b10501d73ebebbc8dfeddfc13a175d/src/feat/pitch-functions.cc#L574-L1235

Test

A new test suite in Kaldi compatibility test
A set of parameters to be tested. Similar to #689
Repository: pytorch/audio

Issue #245: Lazy initialization of MelScale.fb throws when loading module
Created: 2019-08-18T11:25:01Z
Lazy initialization refers to the declaration here and the initialization here. When loading saved model (saved with torch.save()), this causes problem:
size mismatch for reduction.mel_scale.fb: copying a param with shape torch.Size([41, 16]) from checkpoint, the shape in current model is torch.Size([0]).

The problem can be sidestepped by running the model at least once before loading weights. But I'd rather not have to rely on such tricks.
Why is this being lazily initialized anyway?

Duplicate issue #301: RuntimeError: Error(s) in loading state_dict - size mismatch for mel_spectrogram.mel_scale.fb: copying a param with shape torch.Size([1025, 128]) from checkpoint, the shape in current model is torch.Size([0]).
Created: 2019-09-27T15:25:09Z
Not sure what's going on here, but I've submitted a code example:
import torch
import torchaudio


class Example(torch.nn.Module):
	def __init__(self, time_seconds: int = 1, sr: int = 16000, 
		n_mels: int = 2**7, n_fft: int = 2**11, top_db: int = 80):
		super().__init__()

		self._time_seconds = time_seconds
		self._sr = sr
		self._n_mels = n_mels
		self._n_fft = n_fft
		self._top_db = top_db

		self._hop_length = int(self._n_fft / 4)

		self.mel_spectrogram = torchaudio.transforms.MelSpectrogram(sample_rate=self._sr, 
			n_fft=self._n_fft, hop_length=self._hop_length, 
			n_mels=self._n_mels)
		self.amplitude_to_db = torchaudio.transforms.AmplitudeToDB(stype='power', 
			top_db=self._top_db)

	def forward(self, waveform: torch.Tensor):
		mel_spectrogram = self.mel_spectrogram(waveform)
		return self.amplitude_to_db(mel_spectrogram)

model1 = Example()
model2 = Example()

waveform_batch = torch.randn(1024, 1, 16000).type(torch.FloatTensor)

model1(waveform_batch[0]); 	# runs on one sample, no batch support!

model2.load_state_dict(model1.state_dict())

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-19-a8149d9091a8> in <module>
----> 1 model2.load_state_dict(model1.state_dict())

/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py in load_state_dict(self, state_dict, strict)
    843         if len(error_msgs) > 0:
    844             raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
--> 845                                self.__class__.__name__, "\n\t".join(error_msgs)))
    846         return _IncompatibleKeys(missing_keys, unexpected_keys)
    847 

RuntimeError: Error(s) in loading state_dict for Example:
	size mismatch for mel_spectrogram.mel_scale.fb: copying a param with shape torch.Size([1025, 128]) from checkpoint, the shape in current model is torch.Size([0]).

Is there a workaround? Thank you

Closing comment (2019-09-27T19:49:38Z): Hi @engineerchuan thanks for the response. I don't think it's that, but instead, related to #245
Repository: pytorch/audio

Issue #408: torchaudio mobile?
Created: 2020-01-14T19:11:45Z
🚀 Feature
torchaudio should work on Android and iOS platforms
Motivation
Mobile apps need a fast way to preprocess audio (i.e. generate spectrograms).
Pitch
I would love to see a lightweight interface that provides access to all torchaudio functions from Java and ObjectiveC. Heavy logic like FFT should be optimized for performance (i.e. pushed to GPU whenever available).
Alternatives
Tensorflow Lite is moving in this direction (mfcc and most other signal processing ops are already whitelisted).
Additional context

Duplicate issue #631: Support for Raspberry pi?
Created: 2020-05-12T18:15:31Z
❓ Questions and Help
Please note that this issue tracker is not a help form and this issue will be closed.
We have a set of listed resources available on the website. Our primary means of support is our discussion forum:

Discussion Forum

Hello, is support for raspberry pi planned?

Closing comment (2020-05-12T21:40:10Z): I see, so pytorch doesn't support it. This means torchaudio can't either. I'll close this since this is a duplicate of #408.
Repository: pytorch/audio

Issue #79: Making Spectrogram as a layer
Created: 2019-02-05T19:10:28Z
Having the spectrogram transform be a layer for a custom model has big benefits (GPU computation, no need to store the transforms, etc.). Similar to kapre (more in this paper). Making a few modifications to the SPECTROGRAM class would allow for such usage (subclassing nn.Module, using nn.Paramater instead of autograd.Variable for the window, etc.). Thoughts?

Duplicate issue #88: torchaudio-contrib
Created: 2019-03-10T20:31:10Z
Hi all, the torchaudio-contrib repo became public just now. We (@faroit, @ksanjeevan and myself @keunwoochoi) have been working on it so far and there are lots of things to discuss.
Everyone's invited :) let's talk!

Closing comment (2019-03-10T20:34:41Z): (note - It's also related to #79)
Repository: pytorch/glow

Issue #2773: [Runtime efficiency] Don't zero tensors unnecessarily
Created: 2019-04-23T17:04:52Z
Tensors are zeroed on initialization, investigate if/when this can be skipped

Duplicate issue #3037: Don't zero tensors unnecessarily
Created: 2019-06-03T21:33:18Z
Tensors are allocated and zeroed in their constructor, but usually we're going to copy/move data into them anyway without reading the initialized values. Remove this unnecessary step.
Probably requires going through the code for Tensor creation, working out which stuff relies on zeroing and adding a manual zero().

Closing comment (2019-06-04T18:15:17Z): dup of #2773
Repository: pytorch/glow

Issue #1556: Glow should provide its own implementation of a random number generator to ensure deterministic testing and avoid platform-dependent differences
Created: 2018-08-27T23:11:58Z
Glow currently uses the Mersenne Twister engine, which is std::mt19937.
It turns out that this random number generator seeded with the same values generates different random numbers depending on the OS, e.g. it produces different results on MacOS and Linux.
Most likely, the implementation of std::mt19937 is somehow platform-dependent.
To avoid such problems in the future, Glow could use its own in-tree implementation of a random-number generation, which has no target dependencies. It can even be an implementation of mt19937.

Duplicate issue #1557: Random in Glow needs to be portable
Created: 2018-08-27T23:48:01Z
Currently, we have PseudoRNG class, which generates stable numbers from run to run, and each individual test is also stable. However, it uses std::mt19937 and std::uniform_int_distribution inside, which return different results on different platforms: Mac, Linux, Windows. Probably need to rewrite PseudoRNG class to implement hand-written, known to be portable pseudo-random numbers generator.

Closing comment (2018-08-28T00:00:32Z): This is a dup of #1556
Repository: pytorch/glow

Issue #2742: [CI] Fix flakey debug CI job
Created: 2019-04-17T22:11:53Z
After llvm8 migration CI debug build became flakey.
I suspect it's related to the POCL library upgrade to the newer sha.
See: https://circleci.com/gh/pytorch/glow/11480?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link
For example, failure in some random test.
[  PASSED  ] 2 tests.
*** Error in `/var/lib/jenkins/workspace/build/tests/ConvTest': corrupted double-linked list: 0x00000000059a35e0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f512ef737e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x80baf)[0x7f512ef7cbaf]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f512ef8053c]

Duplicate issue #2806: The operator test fails randomly on OpenCL
Created: 2019-04-26T05:17:56Z
[       OK ] OperatorTest/OperatorTest.ConvertFromFloatToFloat/1 (1 ms)
[ RUN      ] OperatorTest/OperatorTest.ConvertFromFloatToFloat/2
[       OK ] OperatorTest/OperatorTest.ConvertFromFloatToFloat/2 (1 ms)
[----------] 594 tests from OperatorTest/OperatorTest (14476 ms total)
[----------] Global test environment tear-down
[==========] 681 tests from 2 test cases ran. (16421 ms total)
[  PASSED  ] 681 tests.
*** Error in `./tests/OperatorTest': double free or corruption (!prev): 0x00000000058085f0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f40dc5947e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f40dc59d37a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f40dc5a153c]
/lib/x86_64-linux-gnu/libc.so.6(+0x39ff8)[0x7f40dc556ff8]
/lib/x86_64-linux-gnu/libc.so.6(+0x3a045)[0x7f40dc557045]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf7)[0x7f40dc53d837]
./tests/OperatorTest[0x4c2da9]
======= Memory map: ========
00400000-0359a000 r-xp 00000000 08:01 2762728                            /var/lib/jenkins/workspace/build/tests/OperatorTest
03799000-03ba8000 r--p 03199000 08:01 2762728                            /var/lib/jenkins/workspace/build/tests/OperatorTest
03ba8000-03bad000 rw-p 035a8000 08:01 2762728                            /var/lib/jenkins/workspace/build/tests/OperatorTest
03bad000-03c0e000 rw-p 00000000 00:00 0
05750000-05d24000 rw-p 00000000 00:00 0                                  [heap]
7f4034000000-7f4034556000 rw-p 00000000 00:00 0
7f4034556000-7f4038000000 ---p 00000000 00:00 0
7f407c000000-7f407e002000 rw-p 00000000 00:00 0
7f407e002000-7f4080000000 ---p 00000000 00:00 0
7f4080000000-7f408102f000 rw-p 00000000 00:00 0
7f408102f000-7f4084000000 ---p 00000000 00:00 0
7f4084000000-7f4086002000 rw-p 00000000 00:00 0
7f4086002000-7f4088000000 ---p 00000000 00:00 0
7f40885f8000-7f40885f9000 r-xp 00000000 08:01 2763485                    /var/lib/jenkins/.cache/pocl/kcache/IJ/AGLIFOIDLPINBLBEKAGOFHCGMFIPLIIGGNFID/dequantizeW/4-1-1/dequantizeW.so
7f40885f9000-7f40887f8000 ---p 00001000 08:01 2763485                    /var/lib/jenkins/.cache/pocl/kcache/IJ/AGLIFOIDLPINBLBEKAGOFHCGMFIPLIIGGNFID/dequantizeW/4-1-1/dequantizeW.so

Closing comment (2019-04-26T18:31:06Z): @jackm321 This is a dup of  #2742. Thank you.  Closing.
Repository: pytorch/glow

Issue #1329: Add support for FP16 and bfloat
Created: 2018-07-25T23:44:48Z
Working with accelerators, we are going to need support for 16-bit floating point types.

FP16 is the binary16 format defined in IEEE 754-2008.
bfloat is the Tensorflow floating point type with the same exponent range as a float.




Type
binary16
bfloat
binary32




k, storage width in bits
16
16
32


w, exponent field width in bits
5
8
8


t, trailing significand field width in bits
10
7
23



We should at a minimum add these types to glow::ElemKind so we can represent low-precision tensors in these types. Ideally, also add interpreter support.

Duplicate issue #1449: FP16 support
Created: 2018-08-12T23:45:44Z
Glow needs to support the FP16 format. This work includes the following subtasks:

New tensor data types (new element type, tensor printer, et.).
Support in the interpreter for the new data type in popular operators (such as conv and matmul).
Conversion utility. Similar to the quantization procedure, the conversion utility needs to take floating point-based networks and convert them to float-16. This procedure will enable the testing of existing networks (from ONNX and our unit tests).
CPU-support for the operators.

Closing comment (2018-08-14T03:41:18Z): Thanks @qcolombet . I'll make this issue as a dup of #1329.
Repository: pytorch/glow

Issue #3228: Extend LLVMIRCodeGen to support compiling multiple Glow functions into a single LLVM Module or object file
Created: 2019-07-12T18:29:58Z
A single glow::Module may contain multiple glow::Functions. It could happen e.g. when Glow uses partitioning or if we would introduce scheduling of subgraphs for parallel execution, etc.
It may be very useful to compile these multiple functions together into the same LLVM module or into the same object file.
To achieve this, some changes in the LLVMIRCodeGen may be required.
Here are some possible LLVMIRCodeGen changes:

When compiling an IRFunction, allow the LLVMBackend to re-use an already existing LLVM module if it is present. This would allow to add more functions to the same module.
Or continue compiling each IRFunction into its own module, but use LLVM's Linker APIs to link those modules together before starting any LLVM optimizations.
BTW, the libjit bitcode is currently read/included into each LLVM module created for each IRFunction. This could be changed to create a separate LLVM module for the libjit and then link the LLVM module(s) produced from an IRFunction (or multiple IRFunctions) with it.
And of course, one should take care of function names to avoid possible name conflicts. Each IRFunction should produce an LLVM::Function with a unique name. All other generated helper LLVM functions should be marked as local to the module, unless they are supposed to be shared by multiple modules (e.g. libjit functions are likely to have a linkage which allows to use them from other modules).

Duplicate issue #3213: Compile should take a Module, not a Function
Created: 2019-07-09T18:45:31Z
Currently, we have the concept of compiling a Function using the EE. This does not align with e.g. the HostManager, wherein we compile a Module instead of a Function. Additionally, when compiling a Function we do optimizations such as DCE on Constants. This is not always safe, as other Functions may still be being built (see #3141) and so Constants shouldn't be deleted so early on.
In general we should compile Modules instead of Functions. We should also move optimizations like DCE for Constants out of optimizeFunction() and into a new optimizeModule() that's performed after all Functions in a Module are optimized.
CC: @gcatron, @opti-mix, @ksaurabh-cadence

Closing comment (2019-07-23T22:27:17Z): Interested in working on this, will do so after EE2 replaces EE in the repo, this is also related to #3228 , once we are compiling at a module level we should probably follow suit and do LLVM IR generation on a module level instead of LLVM Function level.
Repository: pytorch/glow

Issue #1334: Need to redesign the Variable interface.
Created: 2018-07-26T05:06:43Z
Motivation
Currently Glow variables are backed by Tensors, and are tied to the graph. This gives us the ability to perform optimizations such as constant propagation that mutate the content of Tensors. However, it also ties the input/output tensors to the module. This design prevents us from running multithreaded programs simply because the input/output variables (which need to be different for each thread) are a single entity.
Proposed design
The proposed solution is to separate the concept of symbolic variables from graph variables. For example, an input variable X will not be backed by a Tensor until the execution-engine executes the compiled program. To execute the network the caller would need to bind Tensors to variables. The execution engine actually already does this, so we won't need to change the APIs that are used by our unit tests.
To preserve the ability to perform constant propagation (and other tensor-content optimizations) we would need to be able to make some variables concrete during the compilation phase. We would need to have two kinds of variables:
Constant - this is a tensor-backed variable. Similar to LLVM's ConstantArray it's a data structure that lives at the module-level and can be manipulated by transformations.
Variable - this is a typed variable that isn't backed by a real tensor until runtime. The runtime allocates the tensor (either in device memory or on the host) and manages the input/output to and from the variable.

Duplicate issue #1214: [Feature request] Backend-specific tensors
Created: 2018-07-04T14:21:01Z
Backends should be able to implement their own type of tensor objects.
A good example for using this feature would be having tensors backed by OpenCL resources for the OpenCL backend (and similarly for other backends).
In order to support this, the Tensor class can be made more suitable for deriving (adding virtual qualifiers etc.) or create a Tensor interface class for other implementations to derive from.
Additional features for this Tensor interface should include support for lock/unlock (map/unmap) or some other forms of synchronization mechanism.

Closing comment (2018-07-26T19:31:21Z): @jsubag This issue is related to #1334
Repository: pytorch/pytorch

Issue #47109: Pytorch 1.7/Cuda 11.1 binaries
Created: 2020-10-30T08:43:01Z
Will Pytorch 1.7/Cuda 11.1 binaries be provided or only CUDA 11.0?
cc @ezyang @seemethere @malfet @walterddr @ngimel

Duplicate issue #47820: Add CUDA 11.1？
Created: 2020-11-12T01:31:51Z
❓ Questions and Help
When will Linux officially support cuda11.1？

cc @ezyang @seemethere @malfet @walterddr @ngimel

Closing comment (2020-11-13T17:53:43Z): Dupe of #47109, closing
Repository: pytorch/pytorch

Issue #129296: `argsort()`/`msort()`/`sort()` can use the 0D tensor of a `complex` type value against error message
Created: 2024-06-22T02:10:38Z
🐛 Describe the bug
sort() cannot use the tensor of complex type values according to the error message as shown below:
import torch

my_tensor = torch.tensor([7.+5.j])

torch.sort(input=my_tensor) # Error

my_tensor = torch.tensor([[7.+5.j]])

torch.sort(input=my_tensor) # Error

RuntimeError: "sorting_kernel_method_name" not implemented for 'ComplexFloat'

But sort() can use the 0D tensor of a complex type value against the error message as shown below:
import torch

my_tensor = torch.tensor(7.+5.j)

torch.sort(input=my_tensor)
# torch.return_types.sort(
# values=tensor(7.+5.j),
# indices=tensor(0))
Versions
import torch

torch.__version__ # 2.3.0+cu121
cc @malfet

Duplicate issue #129309: `argsort()` can use the 0D tensor of a complex type value against error message
Created: 2024-06-22T16:44:26Z
🐛 Describe the bug
argsort() cannot use the tensor of complex type values according to the error message as shown below:
import torch

my_tensor = torch.tensor([7.+5.j])

torch.argsort(input=my_tensor) # Error

my_tensor = torch.tensor([[7.+5.j]])

torch.argsort(input=my_tensor) # Error

RuntimeError: "sorting_kernel_method_name" not implemented for 'ComplexFloat'

But argsort() can use the 0D tensor of a complex type value against the error message as shown below:
import torch

my_tensor = torch.tensor(7.+5.j)

torch.argsort(input=my_tensor)
# tensor(0)
Versions
import torch

torch.__version__ # 2.3.0+cu121

Closing comment (2024-06-26T00:16:53Z): Closing as duplicate of #129296
Repository: pytorch/pytorch

Issue #86566: Support Python 3.11
Created: 2022-10-10T00:01:47Z
Currently Python 3.11 isn't fully supported in Pytorch yet, including testing in CI and publishing wheels to PyPI.
Python 3.11 is currently in Release Candidate state and will be released in about two weeks. Major packages like NumPy, Pandas, SciPy and Matplotlib have already uploaded their Python 3.11 wheels to PyPI.
Python 3.11 new features include:


PEP 657 -- Include Fine-Grained Error Locations in Tracebacks
PEP 654 -- Exception Groups and except*
PEP 673 -- Self Type
PEP 646-- Variadic Generics
PEP 680-- tomllib: Support for Parsing TOML in the Standard Library
PEP 675-- Arbitrary Literal String Type
PEP 655-- Marking individual TypedDict items as required or potentially-missing
bpo-46752-- Introduce task groups to asyncio
The Faster Cpython Project is already yielding some exciting results: this version of CPython 3.11 is ~ 19% faster on the geometric mean of the PyPerformance benchmarks, compared to 3.10.0.


Pytorch is an import package in the deep learning stack, so support at release will help speed up Python 3.11 adoption.
It would be great to have full Python 3.11 support in Pytorch by the time Python 3.11.0 gets released, (expected Monday October 6th, 2022). This includes testing in CI and publishing wheels to PyPI.
This issue can be used as a tracking issue. This includes:

 Pytorch builds fully on Python 3.11
 All Pytorch tests pass on Python 3.11
 All CI is run and green on Python 3.11
 Wheels are uploaded to PyPI for at least one Pytorch release

 Manylinux (x86_64)
 Manylinux (aarch64)
 Windows
 macOS



cc @seemethere @malfet @pytorch/pytorch-dev-infra @albanD

Duplicate issue #87723: Python3.11 Support
Created: 2022-10-25T19:30:09Z
🚀 The feature, motivation and pitch
With Python3.11 out with speed upgrades, can we get the next version of pytorch to publish wheels for Python 3.11
Alternatives
No response
Additional context
No response

Closing comment (2022-10-25T20:54:31Z): Closing as duplicate of #86566
Repository: pytorch/serve

Issue #2625: Docker Regression on Array failed
Created: 2023-09-28T05:28:07Z
The daily scheduled Docker Regression Run failed, please check why

Duplicate issue #2627: Docker Regression on Array failed
Created: 2023-09-29T05:25:18Z
The daily scheduled Docker Regression Run failed, please check why

Closing comment (2023-09-29T18:19:34Z): same as #2625
Repository: pytorch/serve

Issue #2294: CPU Regression tests failed
Created: 2023-04-30T09:24:17Z
Commit 1707a74 daily scheduled Run Regression Tests on GPU failed, please check why

Duplicate issue #2307: CPU Regression tests failed
Created: 2023-05-02T23:50:15Z
Commit 1707a74 daily scheduled Run Regression Tests on GPU failed, please check why

Closing comment (2023-05-03T17:05:07Z): Same as #2294
Repository: pytorch/serve

Issue #2294: CPU Regression tests failed
Created: 2023-04-30T09:24:17Z
Commit 1707a74 daily scheduled Run Regression Tests on GPU failed, please check why

Duplicate issue #2302: CPU Regression tests failed
Created: 2023-05-02T09:26:07Z
Commit 1707a74 daily scheduled Run Regression Tests on CPU failed, please check why

Closing comment (2023-05-02T16:31:13Z): Same as #2294
Repository: pytorch/serve

Issue #160: Delete model does not delete .mar file in model store
Created: 2020-04-03T17:47:37Z
On deleting a model via the API, the .mar file for it is not removed in the model store folder. As a result if one tries to register the same model again, it fails with an error that file already exists.

Duplicate issue #279: Reregistering model returns 'Model file already exist' after unregistering
Created: 2020-04-28T20:53:24Z
I noticed the following behavior when doing some testing. I'm starting an instance and registering a model via S3 and then unregistering it. I then check the list of models to make sure it's empty again and trying to reregister the same model with the same S3 link but am getting 'Model file already exists".
To reproduce:
Register the model:
curl -X POST "http://localhost:8081/models?url=https://torchserve.s3.amazonaws.com/mar_files/squeezenet1_1.mar"
Unregister it:
curl -X DELETE "http://localhost:8081/models/squeezenet1_1"
List all models, this should return an empty list:
curl -X GET "http://localhost:8081/models/"
And try to register the same model again.
curl -X POST "http://localhost:8081/models?url=https://torchserve.s3.amazonaws.com/mar_files/squeezenet1_1.mar"
This returns a 500 error with 'Model file already exists squeezenet1_1.mar'. But registering with just the mar file name and not the S3 link works (model is successfully registered again). Is this an issue with the snapshot feature @mycpuorg @vdantu?

Closing comment (2020-04-29T00:18:36Z): Duplicate of #160
Repository: pytorch/serve

Issue #2716: Docker Regression on Array failed
Created: 2023-10-15T06:30:38Z
The daily scheduled Docker Regression Run failed, please check why

Duplicate issue #2723: Docker Regression on Array failed
Created: 2023-10-19T06:30:38Z
The daily scheduled Docker Regression Run failed, please check why

Closing comment (2023-10-19T20:53:50Z): Same as #2716