Giter Club home page Giter Club logo

deep-transit's People

Contributors

ckm3 avatar qq332982511 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

deep-transit's Issues

ValueError: cannot reshape array of size 756900 into shape (416,416,4)

When running from the quick start:
bboxes = dt.DeepTransit(lc, is_flat=True).transit_detection(model_path)

I receive the following error:

C:\Users\peter\anaconda3\lib\site-packages\deep_transit\dt_lightcurve.py:317: UserWarning: The total number of progress bar is the upper limit.
  0%|          | 0/4 [00:00<?, ?it/s]
Loading Model: model_Kepler.pth
  0%|          | 0/4 [00:00<?, ?it/s]
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-4-efa83d90cf6f> in <module>
----> 1 bboxes = dt.DeepTransit(lc, is_flat=True).transit_detection(model_path)

~\anaconda3\lib\site-packages\deep_transit\dt_lightcurve.py in transit_detection(self, local_model_path, batch_size, confidence_threshold, nms_iou_threshold, device_str, backend)
    316         rough_length = math.ceil(math.ceil((len(self.lc) * exp_time - 30) / 25 + 1) * 4 / batch_size)
    317         warnings.warn('The total number of progress bar is the upper limit.')
--> 318         for data in tqdm(self._data_loader(batch_size=batch_size, backend=backend), total=rough_length):
    319             lc_data = data[:, 0]
    320             flux_min, flux_max = data[:, 2], data[:, 3]

~\anaconda3\lib\site-packages\tqdm\std.py in __iter__(self)
   1176 
   1177         try:
-> 1178             for obj in iterable:
   1179                 yield obj
   1180                 # Update and possibly print the progressbar.

~\anaconda3\lib\site-packages\deep_transit\dt_lightcurve.py in _data_loader(self, batch_size, backend)
    269             with warnings.catch_warnings():
    270                 warnings.simplefilter("ignore")
--> 271                 chunk = np.array(list(itertools.islice(it, batch_size)))
    272             if chunk.size == 0:
    273                 return

~\anaconda3\lib\site-packages\deep_transit\dt_lightcurve.py in _splited_lc_generator(self, backend)
    258                     if len(splited_flatten_lc) < 1 / exp_time:
    259                         continue
--> 260                     img_arr = _light_curve_to_image_array(splited_flatten_lc, (flux_min, flux_max))
    261                     image = np.array(Image.fromarray(img_arr).convert("L"))
    262                     image = backend.trans(image)

~\anaconda3\lib\site-packages\deep_transit\dt_lightcurve.py in _light_curve_to_image_array(lc_object, flux_range)
    118         ax.set_ylim([flux_range[0], flux_range[1]])
    119         fig.savefig(io_buf, format='raw', dpi=100)
--> 120         img_arr = np.reshape(np.frombuffer(io_buf.getvalue(), dtype=np.uint8),
    121                              newshape=(int(fig.bbox.bounds[3]), int(fig.bbox.bounds[2]), 4))
    122         io_buf.close()

<__array_function__ internals> in reshape(*args, **kwargs)

~\anaconda3\lib\site-packages\numpy\core\fromnumeric.py in reshape(a, newshape, order)
    297            [5, 6]])
    298     """
--> 299     return _wrapfunc(a, 'reshape', newshape, order=order)
    300 
    301 

~\anaconda3\lib\site-packages\numpy\core\fromnumeric.py in _wrapfunc(obj, method, *args, **kwds)
     56 
     57     try:
---> 58         return bound(*args, **kwds)
     59     except TypeError:
     60         # A TypeError occurs if the object does have such a method in its

ValueError: cannot reshape array of size 756900 into shape (416,416,4)

I am running on a cpu. Help?

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.