tclements / phasenet.jl Goto Github PK
View Code? Open in Web Editor NEWGeneralized seismic phase detection using Deep Learning in Julia
License: MIT License
Generalized seismic phase detection using Deep Learning in Julia
License: MIT License
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.