Coder Social home page Coder Social logo

phasenet.jl's People

Contributors

github-actions[bot] avatar tclements avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

violetaseo

phasenet.jl's Issues

A bad choice of "window_samples" crashes PyCall

Hi,

I executed the following code:

using SeisIO
using PhaseNet

S = read_data("mseed", MSEED_FILE) # MSEED_FILE is a three-component miniSEED file of less than 5 minutes of duration
detrend!(S)
sync!(S)

window_samples = 100
batch_size = 256
X = seisdata2torch(S,window_samples)
model_P = load_model("P")
probs_P = detect(X,model_P,batch_size)

And I have this error:

PyError ($(Expr(:escape, :(ccall(#= /home/ivan/.julia/packages/PyCall/twYvK/src/pyfncall.jl:43 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class 'RuntimeError'>
RuntimeError('Sizes of tensors must match except in dimension 1. Expected size 15 but got size 14 for tensor number 1 in the list.')
  File "/home/ivan/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "PyCall", line 1, in <lambda>

Stacktrace:
  [1] pyerr_check
    @ ~/.julia/packages/PyCall/twYvK/src/exception.jl:75 [inlined]
  [2] pyerr_check
    @ ~/.julia/packages/PyCall/twYvK/src/exception.jl:79 [inlined]
  [3] _handle_error(msg::String)
    @ PyCall ~/.julia/packages/PyCall/twYvK/src/exception.jl:96
  [4] macro expansion
    @ ~/.julia/packages/PyCall/twYvK/src/exception.jl:110 [inlined]
  [5] #107
    @ ~/.julia/packages/PyCall/twYvK/src/pyfncall.jl:43 [inlined]
  [6] disable_sigint
    @ ./c.jl:473 [inlined]
  [7] __pycall!
    @ ~/.julia/packages/PyCall/twYvK/src/pyfncall.jl:42 [inlined]
  [8] _pycall!(ret::PyCall.PyObject, o::PyCall.PyObject, args::Tuple{PyCall.PyObject}, nargs::Int64, kw::Ptr{Nothing})
    @ PyCall ~/.julia/packages/PyCall/twYvK/src/pyfncall.jl:29
  [9] _pycall!(ret::PyCall.PyObject, o::PyCall.PyObject, args::Tuple{PyCall.PyObject}, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ PyCall ~/.julia/packages/PyCall/twYvK/src/pyfncall.jl:11
 [10] (::PyCall.PyObject)(::PyCall.PyObject, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ PyCall ~/.julia/packages/PyCall/twYvK/src/pyfncall.jl:86
 [11] (::PyCall.PyObject)(::PyCall.PyObject, ::Vararg{Any})
    @ PyCall ~/.julia/packages/PyCall/twYvK/src/pyfncall.jl:86
 [12] macro expansion
    @ ~/.julia/packages/PhaseNet/ZNXkE/src/detection.jl:120 [inlined]
 [13] macro expansion
    @ ~/.julia/packages/PyCall/twYvK/src/PyCall.jl:660 [inlined]
 [14] detect(X::PyCall.PyObject, model::PyCall.PyObject, batch_size::Int64; device::Nothing)
    @ PhaseNet ~/.julia/packages/PhaseNet/ZNXkE/src/detection.jl:119
 [15] detect(X::PyCall.PyObject, model::PyCall.PyObject, batch_size::Int64)
    @ PhaseNet ~/.julia/packages/PhaseNet/ZNXkE/src/detection.jl:105
 [16] top-level scope
    @ ~/Desktop/phasent_test.jl:16
 [17] include(fname::String)
    @ Base.MainInclude ./client.jl:476
 [18] top-level scope
    @ REPL[1]:1

However, if I set the window_samples to 160, I have no errors, and the code is executed successfully.

So, Are there any combinations of window_samples, batch_size, and npts to bear in mind before applying the detector?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.